问题
当使用Nginx反向代理访问上游服务器的第三方静态页面时候,在Chrome出现如下错误:
ERR_CONTENT_LENGTH_MISMATCH
原因
cd /var/nginx/
drwx------. 12 nobody nginx 86 12月 27 09:38 proxy_temp
proxy_temp文件夹没有属于任何用户。假设运行Nginx进程的用户就叫nginx,即nginx用户不拥有proxy_temp文件夹。从上面可知,只有拥有proxy_temp文件夹的用户才能够读写proxy_temp文件夹。
解决
chown -R nginx proxy_temp
将proxy_temp文件夹的拥有者用户设置为当前运行的nginx进程的用户即可。
参考
- ERR_CONTENT_LENGTH_MISMATCH on nginx and proxy on Chrome when loading large files
- swagger-ui 在Spring boot项目中报错Unable to infer base url