首页 > 代码库 > nginx 长连接

nginx 长连接

upstream appserver {

    

     server 127.0.0.1:18001;

    keepalive 64;

    }


server {

     listen       8888;

     server_name  localhost;

access_log  /data/logs/access.log  main;

        location / {

           root   html;

           index  index.html index.htm;

      proxy_pass        http://appserver;

           proxy_set_header  x-forwarded-for  $remote_addr;

            

           proxy_http_version 1.1;

           proxy_set_header Connection "";

        }

tomcat中修改

server.xml

<Connector port="18001" protocol="HTTP/1.1"

connectionTimeout="2000000000000"

acceptCount="1024"

minProcessors="10"

maxProcessors="1024"

maxThreads="1000"

enableLookups="false"

maxPostSize="0"

URIEncoding="UTF-8"

redirectPort="8443"

compression="on"


keepAliveTimeout="60000"

maxKeepAliveRequests="1000000"


compressableMimeType="text/html,text/xml" />




本文出自 “智能化未来_XFICC” 博客,请务必保留此出处http://xficc.blog.51cto.com/1189288/1878944

nginx 长连接