zoukankan      html  css  js  c++  java
  • the server responded with a status of 414 (Request-URI Too Large)

    nginx 配置不当,前端ajax调用报错:

    the server responded with a status of 414 (Request-URI Too Large)

    浏览器F12报错如下:

    原因是:url 中的 参数太长,超过了nginx默认值,解决方法:

    在nginx.conf中加入下面的参数(client_header_buffer_size 和 large_client_header_buffers ):

    server {
    listen 80;
    server_name localhost;

    client_header_buffer_size 2m;
    large_client_header_buffers 4 200m;

    ----------------------------------

    https://stackoverflow.com/questions/1067334/how-to-set-the-allowed-url-length-for-a-nginx-request-error-code-414-uri-too

    Syntax: large_client_header_buffers number size ;
    Default: large_client_header_buffers 4 8k;
    Context: http, server

    Sets the maximum number and size of buffers used for reading large client request header. A request line cannot exceed the size of one buffer, or the 414 (Request-URI Too Large) error is returned to the client. A request header field cannot exceed the size of one buffer as well, or the 400 (Bad Request) error is returned to the client. Buffers are allocated only on demand. By default, the buffer size is equal to 8K bytes. If after the end of request processing a connection is transitioned into the keep-alive state, these buffers are released.

  • 相关阅读:
    获取具有指定扩展数据的所有实体的Id,并存入Id数组中
    FastDFS单机版安装教程
    Git简要开发流程
    Delay延迟队列
    HTTP调用接口方法
    Tomcat为什么要使用Facde模式对Request对象进行包装?
    SpringBoot注解
    <th:>标签使用
    Git命令速查表
    IDEA中对Git的常规操作(合并,提交,新建分支,更新)
  • 原文地址:https://www.cnblogs.com/digdeep/p/8336850.html
Copyright © 2011-2022 走看看