zoukankan      html  css  js  c++  java
  • nginx修改上传文件大小限制

             新装了一台服务器,用nginx做代理。突然发现上传超过1M大的客户端文件无法正常上传,于是修改了下nginx的配置。

             cd /export/servers/nginx/conf/nginx.conf,在这个配置文件里面的server段里面的

    location / {
                root   html;
                index  index.html index.htm;
       client_max_body_size    1000m;#没有的可自行加上
      }

             加上了client_max_body_size    字段,怎么重启都不行。后来在总配置文件里面发现了分配置文件:

    sendfile        on;
        #tcp_nopush     on;
                
        #keepalive_timeout  0;
        keepalive_timeout  65;
                  
        #gzip  on;
        include domains/*;
        #include domains/chat.local;
        #include domains/chat.erp.com;
        #include domains/support.chat.com;
        #include douains/chat.com;
        
        server {
            listen       80; 
            server_name  localhost; 



    于是找到了分配置文件,在分配置文件里面进行修改。分配置文件配置如下:


    server
            {
               listen   80;
               server_name  chat.erp.360buy.com;
    #          access_log    /export/servers/nginx/logs/chat.erp.360buy.com;
               location / {
               proxy_pass     http://tomcat;
                    client_max_body_size    1000m;
                 }
            }
            用/export/servers/nginx/sbin/nginx -s reload重启下,上传文件的大小受限的问题就解决了。

  • 相关阅读:
    每周学算法/读英文/知识点心得分享 1.28
    ARTS 1.21
    ARTS 1.14
    ARTS 1.7
    ARTS 12.31
    ARTS 12.24
    Leetcode : Median of Two Sorted Arrays
    我是怎样改善遗留系统的
    《大话重构》免费送书活动开始啦
    我的新书终于要出来啦
  • 原文地址:https://www.cnblogs.com/chjbbs/p/4181544.html
Copyright © 2011-2022 走看看