nginx靜態資源無效問題


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/,就會出現重定向錯誤問題。
    }


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM