Hylton Peimer
Hylton Peimer

Reputation: 648

spring-ws behind a Zuul proxy

I have a microservice (spring-boot) implementing a WSDL using spring-WS. The plan is to access the WSDL through a gateway server, using Zuul.

Accessing from the Gateway: http//192.168.1.5:8080/integration/ws/test.wsdl

The Zuul route is configured at the Gateway:

integration:
  sensitive-headers:
  path: /integration/**
  url: http://localhost:9090

The WSDL is returned with the correct Port number (8080) but incorrect hostname. Also the prefix "/integration" is not returned.

<wsdl:service name="TestPortService">
    <wsdl:port binding="tns:TestPortSoap11" name="TestPortSoap11">
         <soap:address location="http://localhost:8080/ws"/>
    </wsdl:port>
</wsdl:service>

Even if I manually set X-Forwarded-For headers, the hostname never seems to change. [This I test without Zuul]. What am I missing in order to get Spring-WS working behind a proxy? I have set remote_ip_header & protocol_header in Spring boot's application properties.

Upvotes: 3

Views: 2527

Answers (1)

Grinish Nepal
Grinish Nepal

Reputation: 3075

Zuul actually strips the proxy prefix from the request before the request is forwarded by default. You can switch off this behaviour with stripPrefix=false like below for individual service. If you want for all routings then zuul.stripPrefix=false

application.yml
 zuul:
  routes:
    users:
      path: /myusers/**
      stripPrefix: false

Hope this will solve your issue.

Upvotes: 2

Related Questions