May 11, 2010 03:48AM
On Mon, May 10, 2010 at 05:37:58PM +0800, 冉兵 wrote:

> Hi,
>
> 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.
>
> Here is the config being used:
>
> // ....
>
> server
> {
> 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;

Why do use so many header with remote address ?
BTW, the last X-Forwarded-For overrides the previous one.

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

You may try to set webservice to listen on 127.0.0.1:80 and set nginx
to listen on mysolr:80.

Also you may use

sub_filter http://mysolr:80/ http://mysolr:89/;
sub_filter_once off;


--
Igor Sysoev
http://sysoev.ru/en/

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

proxy to a .Net webservice

冉兵 May 10, 2010 05:42AM

Re: proxy to a .Net webservice

冉兵 May 11, 2010 12:06AM

Re: proxy to a .Net webservice

Igor Sysoev May 11, 2010 03:48AM

Re: proxy to a .Net webservice

冉兵 May 11, 2010 06:28AM

Re: proxy to a .Net webservice

pricne5 October 17, 2011 07:48AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 175
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready