我有一个使用spring-WS实现WSDL的微服务(spring-boot)。我们的计划是使用Zuul通过网关服务器访问WSDL。
从网关访问: http//192.168.1.5:8080/integration/ws/test.wsdl
在网关配置Zuul路由:
integration:
sensitive-headers:
path: /integration/**
url: http://localhost:9090返回的WSDL具有正确的端口号(8080),但主机名不正确。前缀"/integration“也不会返回。
<wsdl:service name="TestPortService">
<wsdl:port binding="tns:TestPortSoap11" name="TestPortSoap11">
<soap:address location="http://localhost:8080/ws"/>
</wsdl:port>
</wsdl:service>即使我手动设置了X-Forwarded-For headers,主机名似乎永远不会改变。这是我在没有Zuul的情况下测试的。为了让Spring-WS在代理后面工作,我缺少什么?我已经在Spring boot的应用程序属性中设置了remote_ip_header & protocol_header。
发布于 2016-08-13 04:47:19
默认情况下,在转发请求之前,Zuul实际上从请求中剥离了代理前缀。对于单个服务,您可以使用stripPrefix=false关闭此行为,如下所示。如果您想要所有路由,那么zuul.stripPrefix=false
application.yml
zuul:
routes:
users:
path: /myusers/**
stripPrefix: false希望这能解决你的问题。
https://stackoverflow.com/questions/38921887
复制相似问题