proxy_pass for subfolders

basti black.fledermaus at arcor.de
Fri Oct 14 11:51:09 UTC 2016


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 at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
> 



More information about the nginx mailing list