basti
October 14, 2016 07:52AM
Hello,
try somethink like

location /folder1/ {
rewrite /folder1/(.*)$ /app/$1 break;
proxy_pass http://site2.ltd;
proxy_redirect off;
// this is only for loging on site2 to see the ip of the user and not
the ip of proxy server
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_max_temp_file_size 0;
}

Best Regards,
Basti

p.s i use this to proxy an wordpress site

On 14.10.2016 12:53, avk wrote:
> Hi! Can you help? How use proxy_pass (or other methods) for proxy
> subfolder-requests? Example: site1.ltd/folder1 -> proxy to site2.ltd/app
> Thx!
>
> Posted at Nginx Forum: https://forum.nginx.org/read.php?2,270269,270269#msg-270269
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
>

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

proxy_pass for subfolders

avk October 14, 2016 06:53AM

Re: proxy_pass for subfolders

basti October 14, 2016 07:52AM

Re: proxy_pass for subfolders

avk October 14, 2016 10:28AM

Re: proxy_pass for subfolders

basti October 14, 2016 01:32PM

Re: proxy_pass for subfolders

avk October 17, 2016 10:24AM

Re: proxy_pass for subfolders

Francis Daly October 14, 2016 10:58AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 364
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready