"nginx + jetty" - post 업로드 body size 의 제한 문제
                                            
 3406 단어  nginx
                    
client_max_body_size 0; //무제 한
4. 567914. 4. 567914 보다 크 면 이상 을 던 집 니 다. 4. 567914. 기본 값 은 200000 입 니 다.
path: /etc/nginx/nginx.conf
http {
    include       /etc/nginx/mime.types;
    access_log  /var/log/nginx/access.log;
    sendfile        on;
    #tcp_nopush     on;
    #keepalive_timeout  0;
    keepalive_timeout  65;
    tcp_nodelay        on;
    gzip  on;
    gzip_disable "MSIE [1-6]\.(?!.*SV1)";
    include /etc/nginx/conf.d/*.conf;
    include /etc/nginx/sites-enabled/*;
    client_max_body_size 0; //64M
}
2 jetty 설정 수정 빨간색 부분 증가, 최대 폼 크기 수정
org.mortbay.jetty.Request.maxFormContentSize
- 1 은 무제 한, 기본 200 k
path: /etc/jetty/jetty.xml
<Call name="addConnector">
      <Arg>
          <New class="org.mortbay.jetty.nio.SelectChannelConnector">
            <Set name="host"><SystemProperty name="jetty.host" /></Set>
            <Set name="port"><SystemProperty name="jetty.port" default="8080"/></Set>
            <Set name="maxIdleTime">30000</Set>
            <Set name="Acceptors">2</Set>
            <Set name="statsOn">false</Set>
            <Set name="confidentialPort">8443</Set>
            <Set name="forwarded">true</Set>
            <Set name="forwardedServerHeader">ignore</Set>
            <Set name="forwardedHostHeader">ignore</Set>
            <Set name="lowResourcesConnections">5000</Set>
            <Set name="lowResourcesMaxIdleTime">5000</Set>
          </New>
      </Arg>
    </Call>
 <Call class="java.lang.System" name="setProperty">
         <Arg>org.mortbay.jetty.Request.maxFormContentSize</Arg>
         <Arg>-1</Arg>
  </Call>--------------------
tomcat 기본 허용 콘 텐 츠 - length = 2×1024×1024
// 내용 이 너무 길 면 바로 돌아 갑 니 다. Jetty 는 Illegal State Exception 을 던 집 니 다.
protected void parseParameters() {  
......  
    if (!("application/x-www-form-urlencoded".equals(contentType)))  
        return;  
    int len = getContentLength();   
    if (len > 0) {  
        int maxPostSize = connector.getMaxPostSize();   // tomcat    2*1024*1024    
        if ((maxPostSize > 0) && (len > maxPostSize)) {  
            if (context.getLogger().isDebugEnabled()) {  
                context.getLogger().debug(  
                        sm.getString("coyoteRequest.postTooLarge"));  
            }  
            return;   //          ,jetty   IllegalStateException  
            //Parameters         
    }  
.....  
}  이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
간단! Certbot을 사용하여 웹 사이트를 SSL(HTTPS)화하는 방법초보자가 인프라 주위를 정돈하는 것은 매우 어렵습니다. 이번은 사이트를 간단하게 SSL화(HTTP에서 HTTPS통신)로 변경하는 방법을 소개합니다! 이번에는 소프트웨어 시스템 Nginx CentOS7 의 환경에서 S...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.