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