我正在尝试Proxy Pass
/do/uploads.php?id=xxx
在/do/upload?id=xxx
Nginx 中
这是我的尝试
location /do {
rewrite /do/uploads\.php /do/uploads$1 break;
proxy_pass http://domain/do;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
}
答案1
我找到了一个解决方案。如下:
location = /do/uploads.php {
proxy_pass http://domain/switch/do;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
}