nginx修改限制请求体的大小
Nginx 修改 请求 大小 限制
2023-09-14 09:00:00 时间
POST数据太大,导致nodejs服务请求失败,本地好好的,但是在服务器上修改之后仍然不成功
仔细想了下,服务器使用了nginx反向代理,nginx限制了请求大小,默认是1M,超出限制会出现413错误
解决的方法
server { listen 3001; server_name 127.0.0.1; proxy_cache nginx; proxy_cache_valid 301 302 20m; proxy_cache_valid any 5m; location / { proxy_pass http://127.0.0.1:2001; client_max_body_size 1000m; gzip on; gzip_min_length 1k; gzip_buffers 4 16k; #gzip_http_version 1.0; gzip_comp_level 2; gzip_types text/plain application/json application/javascript application/x-javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png; gzip_vary off; gzip_disable "MSIE [1-6]\."; #缓存设置 proxy_ignore_headers Set-Cookie Cache-Control; proxy_hide_header Cache-Control; proxy_hide_header Set-Cookie; proxy_set_header Host $proxy_host:$proxy_port; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; add_header X-Via $server_addr; add_header X-Upstream $upstream_addr; add_header Nginx-Cache $upstream_cache_status; } }
重启nginx
相关文章
- FastDFS整合Nginx的模块:fastdfs-nginx-module报错:fdfs_define.h:15:27: 致命错误:common_define.h:没有那个文件或目录
- Nginx里Header修改
- Nginx编译安装lua-nginx-module
- Nginx配置文件(nginx.conf)配置详解
- 利用nginx泛域名解析配置二级域名和多域名
- nginx配置client_body_temp_path
- 压力测试工具ab及centos下单独安装方法 nginx和tomcat静态资源的性能测试
- Nginx配置文件(nginx.conf)配置详解
- Tomcat详解(八)——Tomcat与Nginx实现动静分离
- Nginx http_proxy_module模块实现缓存代理服务器
- Prometheus nginx-vts-exporter 监控 Nginx
- 什么是nginx负载均衡高可用
- nginx修改端口后,访问项目报错404
- 【项目实战】Nginx配置解读
- 【异常】Nginx报错: [emerg] unknown directive ““ in /usr/local/nginx/nginx.conf:xx
- Nginx RTMP源码分析--GOP的实现
- nginx 反向代理 Nginx 502 Bad Gateway
- nginx alias和root的使用
- 47 openEuler搭建Nginx服务器-配置文件说明和管理模块
- Nginx主配置文件各参数说明——筑梦之路
- 15.Nginx 解析漏洞复现
- nginx 反向代理
- docker修改容器内nginx配置文件
- Nginx(4):守护进程,一份nginx实现,一份我的实现,看着拿呗