Nginx reverse proxy on another web server with redirection

Hi all,
I have the problem with configuring nginx to perform proxy redirection
to
web server that appends some its local path to redirected address. As a
result I get url of my server (where nginx is running) but with path
(from
another machine) appended.

The configuration is:
location ~* ^/3rdparty/(.)___(.)___(.)___(.)$ {
proxy_pass https://$1.$2.$3.$4?$args;
proxy_redirect off;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For
$proxy_add_x_forwarded_for;
}

When I type this:
http:// 192.168.237.208/3rdparty/192___168___237___222
I would expect content from here:
https://192.168.237.222
but I get attempt from server to get content from here - which doesn’t
exist:
http://192.168.237.208/3rdparty/192___168___237___222/users/sign_in

How to remove /users/sign_in sufix but to process that within nginx
server?

When I go directly to target server typing this:
https://192.168.237.222
I get redirected to
https://192.168.237.222/users/sign_in which brings the right content.

Thank you in advance for you comments/help!

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,249291,249291#msg-249291

I have also added more detailed description with system diagram at:
http://stackoverflow.com/questions/23068740/nginx-reverse-proxy-on-another-web-server-with-redirection
Thank you!

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,249291,249292#msg-249292

Quick sidenote, not scratching the surface of your problem:
I would have posted on ServerFault, not StackOverflow

B. R.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs