Welcome! Log In Create A New Profile

Advanced

Nginx reverse proxy on another web server with redirection

April 14, 2014 04:07PM
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!
Subject Author Posted

Nginx reverse proxy on another web server with redirection

fijfajfu April 14, 2014 04:07PM

Re: Nginx reverse proxy on another web server with redirection

fijfajfu April 14, 2014 04:10PM

Re: Nginx reverse proxy on another web server with redirection

B.R. April 14, 2014 09:36PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 272
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