nginx 400、403、413错误

1、403 Forbidden

在这里插入图片描述

解决

  1. nginx用户无权访问目标文件;

    授权文件

    chmod -R 777
    
  2. 由于启动用户和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).

解决

  1. 修改配置文件

    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

在这里插入图片描述

解决

  1. 修改配置文件

    vi nginx.conf
    client_header_buffer_size 16k;  //这里默认是4K
    

    在这里插入图片描述2. 检查配置文件;

    cd /opt/nginx/sbin/
    ./nginx -t
    

    提示seccessful后重启nginx

    ./nginx -s reload
    
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值