Nginx静态资源无法加载

项目部署到nginx,访问资源的时候发现了静态资源无法加载的问题,谷歌报错为ERR_NAME_NOT_RESOLVED。
解决方案:

在Nginx的配置文件中nginx.conf里面配置server的地方加上如下配置

location ~ .* {
	proxy_pass http://配置名称;
	proxy_set_header Host $http_host;
	proxy_set_header X-Real-IP $remote_addr;
	proxy_set_header X-Fonwarded-For $proxy_add_x_forwarded_for;
}

猜你喜欢

转载自blog.csdn.net/drsarah/article/details/104801172