proxy_pass for subfolders

avk nginx-forum at forum.nginx.org
Mon Oct 17 14:24:45 UTC 2016


>From proxy server :
2016/10/17 14:19:38 [error] 6735#6735: *236 open()
"/var/lib/nginx/html/000001" failed (2: No such file or directory),
client:ip, server: localhost, request: "GET /000001 HTTP/1.1"

>From srv1 & srv2:
- [17/Oct/2016:14:16:47 +0000] "GET /123456 HTTP/1.1" 301 185 "-"
"Mozilla/5.0 (X11; Linux x86_64; rv:49.0) Gecko/20100101 Firefox/49.0"

nginx (proxy) conf:

location /123456/ {
rewrite /123456/(.*)$ /$1 break;
proxy_pass http://SRV1/;
proxy_redirect off;
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;

Posted at Nginx Forum: https://forum.nginx.org/read.php?2,270269,270330#msg-270330



More information about the nginx mailing list