Nginx 414 Request-URI Too Large

Nginx 414 Request-URI Too Large

  •  2018 年 12 月 18 日
  •  493
  •  Nginx 

中毒症状


原因及解决办法

造成这个问题的原因是请求头大小超出限制,需要在Nginx配置文件中添加参数client_header_buffer_sizelarge_client_header_buffers,代码如下:

http {
    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;

    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
    '$status $body_bytes_sent "$http_referer" '
    '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  /var/log/nginx/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    keepalive_timeout  65;

    #gzip  on;

    #设置请求头
    client_header_buffer_size 512k;
    large_client_header_buffers 4 512k;

    include /etc/nginx/conf.d/*.conf;
}

扫一扫分享到微信

已有 条评论
写评论