Nginx reverse proxy on another web server with redirection

fijfajfu nginx-forum at
Mon Apr 14 20:07:24 UTC 2014

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

When I type this:
I would expect content from here:
but I get attempt from server to get content from here - which doesn't

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

When I go directly to target server typing this:
I get redirected to which brings the right content.

Thank you in advance for you comments/help!

Posted at Nginx Forum:,249291,249291#msg-249291

More information about the nginx mailing list