proxy to a .Net webservice

冉兵 bing_ran at
Tue May 11 08:02:17 MSD 2010

Anyone please?

From: 冉兵 
Sent: Monday, May 10, 2010 5:37 PM
To: nginx at 
Subject: proxy to a .Net webservice


Company is testing nginx with a .net SOAP web service. The nginx and web service runs on two different ports. The problem is the web service returns the response with links that point to the web service's own TCP port instead of the port of the Nginx, i.e., the web service server does not realize that requests come via a proxy on a different port. 

Here is the config being used:

// ....

    listen  89;
    server_name  mysolr;

    location / {
        proxy_pass        http://mysolr/;
        proxy_redirect off;
        proxy_set_header Host $host:$server_port;
        proxy_set_header X-Real-IP  $remote_addr;
        proxy_set_header REMOTE-HOST $remote_addr;
        proxy_set_header X-Forwarded-For $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

In the above case, response comes back with all embedded links on port 80 rather than on 89. 

Any help is appreciated~



nginx mailing list
nginx at
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the nginx mailing list