开发者社区> 问答> 正文

Nginx Timeout的问题,使用的Tomcat出现问题,如何解决?

Nginx的error日志为:
1
完全不知道怎么回事了,Nginx转发到Tomcat这个过程非常缓慢,长达1.5min以上,可以用上面的域名访问测试下。
相关配置参数:

server {
        listen       80;
        server_name  cms.caitb.com;
        
        location ~ .*\.(htm|html|gif|jpeg|png|bmp|swf|ioc|rar|zip|txt|flv|mid|doc|ppt|pdf|xls|mp3|wma|woff|jpg)$ {   #设置静态网页直接由nginx进行处理
            root D:/APP/apache-tomcat-8.0.26-8081/webapps;
            expires 30d;
        }
        
        location ~ .*\.(js|css)?$ {
            root D:/APP/apache-tomcat-8.0.26-8081/webapps;
            expires 1h;
        }
                
        location / {
            proxy_pass http://localhost:8081;
            
            proxy_redirect          off;
            proxy_set_header        Host $host;
            client_max_body_size    10m;
            client_body_buffer_size 128k;
            proxy_connect_timeout   90;
            proxy_send_timeout      150;
            proxy_read_timeout      150;
            proxy_buffer_size       16k;
            proxy_buffers           4 64k;
            proxy_busy_buffers_size 128k;
            proxy_temp_file_write_size 128k;
          
        }
    }

展开
收起
落地花开啦 2016-06-02 15:13:55 3498 0
1 条回答
写回答
取消 提交回答
  • 喜欢技术,喜欢努力的人

    proxy_pass http://localhost:8081;
    localhost 换成IP试试

    2019-07-17 19:24:58
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
《Nginx 代理系统常用手册》 立即下载
CentOS Nginx PHP JAVA 多语言镜像使用手 立即下载
CentOS Nginx PHP JAVA多语言镜像使用手册 立即下载