1.先說問題
在nginx轉發訪問某個頁面的時候,效果展示:
非轉發形式:
轉發:
nginx代理配置文件添加:
location /njazx {
proxy_pass http://localhost:8088/njazx;
# proxy_params
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;
proxy_set_header X-Forwarded-Proto $scheme;
}
https://blog.csdn.net/zhangjunli/article/details/80436489
2. 重定向次數問題。
在根路徑下配置轉發
server {
listen 88;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
proxy_pass http://localhost:8089/disk; //若此處disk沒有后綴(沒有訪問到該文件下的資源)——disk/,就會出現重定向錯誤問題。
}