1、403 Forbidden
解决
-
nginx用户无权访问目标文件;
授权文件
chmod -R 777
-
由于启动用户和nginx工作用户不一致所致;
修改文件
vi nginx.cong
2、Nginx 413 Request Entity Too Large
![在这里插入图片描述](https://img-blog.csdnimg.cn/20200407200828299.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0NyYXp5MjIzMzQ=,size_16,color_FFFFFF,t_70)
==client_max_body_size==
==syntax: client_max_body_size size==
==default: client_max_body_size 1m==
==context: http, server, location==
==Directive assigns the maximum accepted body size of client request, indicated by the lineContent-Lengthin the header of request.==
==If size is greater the given one, then the client gets the error "Request Entity Too Large" (413).==
==It is necessary to keep in mind that the browsers do not know how to correctly show this error.==
参考: [Nginx中文文档](http://www.nginx.cn/doc/standard/httpcore.html).
解决
-
修改配置文件
vi nginx.conf
client_max_body_size 10m;
2. 检查配置文件;
cd /opt/nginx/sbin/ ./nginx -t
提示seccessful后重启nginx
./nginx -s reload
3、Nginx 400 Request Header Or Cookie Too Large
解决
-
修改配置文件
vi nginx.conf client_header_buffer_size 16k; //这里默认是4K
2. 检查配置文件;
cd /opt/nginx/sbin/ ./nginx -t
提示seccessful后重启nginx
./nginx -s reload