网站中图片过大无法正常显示,通常显示一半,就提示502错误了,Nginx 错误日志代理提示:
2021/05/19 16:28:35 [crit] 10976#0: *13 open() "/nginx_dir/proxy_temp/2/00/0000000002" failed (13: Permission denied) while reading upstream, client: 200.130.237.38, server: test.com, request: "GET /uploads/images/20210220/48a18881fa3b45781b512f2376c9bef8.gif HTTP/1.1", upstream: "http://127.0.0.1:3001/uploads/images/20210220/48a18881fa3b45781b512f2376c9bef8.gif", host: "www.test.com", referrer: "https://www.test.com/cat/5"
当前nginx的用户是谁
ps aux | grep "nginx: worker process"
然后查看
ll /nginx_dir/proxy_temp
发现一切正常,尝试调整缓存大小限制,无效。
放弃使用node提供静态文件功能,使用nginx 直接托管上传后的静态文件,nginx配置文件中加入:
location /uploads { alias /www/test_com/static/uploads; }
声明:本站所有文章和图片,如无特殊说明,均为原创发布。商业转载请联系作者获得授权,非商业转载请注明出处。