1

we have an Nginx reverse proxy set to send traffic from:

https://ws.mydomain.com/staging/service.asmx

to our IIS Server 10:

http://localmachine/ws/staging/service.asmx

(sending ws.mydomain.com as host header)

The problem is that when we call https://ws.mydomain.com/staging/service.asmx?WSDL the auto-generated wsdl shows a MIXED endpoint:

<soap:address location="http://ws.mydomain.com/ws/staging/service.asmx"/>

instead of

<soap:address location="https://ws.mydomain.com/staging/service.asmx"/>

I googled a lot but I couldn't find a way to force, via web.config, a specific URL - or to specify a base address (everything BEFORE service.asmx).

gmic
  • 11
  • 1

1 Answers1

1

In the Apache server, the functionality could be achieved by the ProxyPreserveHost directive when the Apache works as a reverse proxy.
http://httpd.apache.org/docs/2.2/mod/mod_proxy.html#proxypreservehost
There is no ProxyPreserveHost in Nginx, but you can try proxy_set_header directive.

proxy_set_header Host $host;

Please refer to the below links.
https://serverfault.com/questions/87056/when-nginx-is-configured-as-reverse-proxy-can-it-rewrite-the-host-header-to-the
https://www.nginx.com/resources/wiki/start/topics/examples/likeapache/
Also, here is a workaround for overriding the WSDL location property.
WebService behind reverse proxy
Feel free to let me know if there is anything I can help with.

Abraham Qian
  • 7,117
  • 1
  • 8
  • 22
  • Hi, we have set already proxy_set_header, but it just solves the "domain" part, it doesn't affect the translated address. Please note that our nginx is translating /staging/service.asmx to /ws/staging/service.asmx , so the heades is not enough – gmic Jul 30 '20 at 11:14