收藏
回答

nginx+springboot,每运行一段时间都会出现A error occurred错误?

微信后台是nginx+springboot,发布运行没问题,但每运行一段时间都会出现A error occurred错误,如果重启服务器又能正常运行。

观察猜测是用户大量访问的时间段会出现这个问题。我猜是nginx配置问题。网上搜索大量信息无果,没找到有效解决方法。这个是一个煤气微信收费程序。服务器配置如下,且硬盘空间足够。

nginx的错误日志如下:

2022/05/21 21:22:35 [error] 1792#1876: *67178 connect() failed (10061: No connection could be made because the target machine actively refused it) while connecting to upstream, client: 113.231.103.146, server: tmmcq.tfcoal.com, request: "GET /public/wxweb/autback?code=051T6oFa1Q22dD08ROFa1UYMzA3T6oFG&state=http%3A%2F%2Ftmmcq.tfcoal.com%2Findex.html HTTP/1.1", upstream: "http://127.0.0.1:81/public/wxweb/autback?code=051T6oFa1Q22dD08ROFa1UYMzA3T6oFG&state=http%3A%2F%2Ftmmcq.tfcoal.com%2Findex.html", host: "tmmcq.tfcoal.com"

2022/05/21 21:22:36 [error] 1792#1876: *67188 connect() failed (10061: No connection could be made because the target machine actively refused it) while connecting to upstream, client: 175.24.214.150, server: tmmcq.tfcoal.com, request: "POST /public/wxweb/receivemsg?signature=4270528b64b778277118d37d8a726c7b75c25d97&timestamp=1653139331&nonce=409298341&openid=o6U2vuNAQwSrPNieKcqk7Bd6fHn8 HTTP/1.1", upstream: "http://127.0.0.1:81/public/wxweb/receivemsg?signature=4270528b64b778277118d37d8a726c7b75c25d97&timestamp=1653139331&nonce=409298341&openid=o6U2vuNAQwSrPNieKcqk7Bd6fHn8", host: "tmmcq.tfcoal.com"

请求大神解答,谢谢

配置文件信息我在下方回复里贴出来了,麻烦您给看看。

最后一次编辑于  2022-05-22
回答关注问题邀请回答
收藏

4 个回答

  • momo
    momo
    2022-05-22

    盲猜 tomcat 并发打满了,建议看 spring 日志或者 jstack ,也可以先加几个节点试试

    2022-05-22
    有用 1
    回复 1
    • 2022-05-23
      谢谢回复
      2022-05-23
      回复
  • fixan
    fixan
    2023-02-24

    老哥,您这个问题解决了吗?我也遇到了这个问题,指导下呗

    2023-02-24
    有用
    回复
  • 跨商通
    跨商通
    2022-05-22

    1、来错论坛了。

    2022-05-22
    有用
    回复 1
    • 2022-05-23
      那应该发哪
      2022-05-23
      回复
  • 2022-05-22
    #user  nobody;
    worker_processes  1;
    
    #error_log  logs/error.log;
    #error_log  logs/error.log  notice;
    #error_log  logs/error.log  info;
    
    #pid        logs/nginx.pid;
    
    
    events {
        worker_connections  1024;
    }
    
    
    http {
        include       mime.types;
        default_type  application/octet-stream;
    
    
        #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
        #                  '$status $body_bytes_sent "$http_referer" '
        #                  '"$http_user_agent" "$http_x_forwarded_for"';
    
        #access_log  logs/access.log  main;
    
        sendfile        on;
        #tcp_nopush     on;
    
        #keepalive_timeout  0;
        keepalive_timeout  65;
    
        #gzip  on;
    
        server {
            listen       80;
            server_name  tmmcq.tfcoal.com mcqgs.tfcoal.com;
    
            #charset koi8-r;
    
            #access_log  logs/host.access.log  main;
    
            location / {
                proxy_pass http://127.0.0.1:81/;
                proxy_set_header Host $http_host;
                proxy_set_header  X-Real-IP  $remote_addr;  
                proxy_set_header  X-Forwarded-For  $proxy_add_x_forwarded_for;
                root   html;
                index  index.html index.htm;
            }
    
            #error_page  404              /404.html;
    
            # redirect server error pages to the static page /50x.html
            #
            error_page   500 502 503 504  /50x.html;
            location = /50x.html {
                root   html;
            }
    
            # proxy the PHP scripts to Apache listening on 127.0.0.1:80
            #
            #location ~ \.php$ {
            #    proxy_pass   http://127.0.0.1;
            #}
    
            # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
            #
            #location ~ \.php$ {
            #    root           html;
            #    fastcgi_pass   127.0.0.1:9000;
            #    fastcgi_index  index.php;
            #    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
            #    include        fastcgi_params;
            #}
    
            # deny access to .htaccess files, if Apache's document root
            # concurs with nginx's one
            #
            #location ~ /\.ht {
            #    deny  all;
            #}
        }
    
        # another virtual host using mix of IP-, name-, and port-based configuration
        #
        #server {
        #    listen       8000;
        #    listen       somename:8080;
        #    server_name  somename  alias  another.alias;
    
        #    location / {
        #        root   html;
        #        index  index.html index.htm;
        #    }
        #}
    
    
        # HTTPS server
        #
        #server {
        #    listen       443 ssl;
        #    server_name  localhost;
    
        #    ssl_certificate      cert.pem;
        #    ssl_certificate_key  cert.key;
    
        #    ssl_session_cache    shared:SSL:1m;
        #    ssl_session_timeout  5m;
    
        #    ssl_ciphers  HIGH:!aNULL:!MD5;
        #    ssl_prefer_server_ciphers  on;
    
        #    location / {
        #        root   html;
        #        index  index.html index.htm;
        #    }
        #}
    
    }
    
    
    
    2022-05-22
    有用
    回复
登录 后发表内容