Page 1 of 1

111: connection refused while connecting to upstream [Solved]

Posted: Fri Dec 08, 2017 4:02 pm
by vanderheyde
Hi,

when browsing to any client domain (vestacp interface works fine), i receive a 500 internal server error.

From /var/log/apache/domain/xxx.error.log, i get this:

Code: Select all

2017/12/08 16:44:04 [error] 1651#1651: *38 connect() failed (111: Connection refused) while connecting to upstream, c lient: xx.xx.xx.xx, server: xxx.com, request: "GET / HTTP/1.1", upstream: "http://yy.yy.yy.yy:8080/", host: "xxx.com", referrer: "http://xxx.com/"
nginx does not return any errors, neither does php5-fpm.

I'm at a loss. I can't find any other error to troubleshoot this issue, and I'm unsure of what to make of the one I have.

Any and all help would be appreciated :)

/home/xxx/conf/web/apache2.conf below:

Code: Select all

<VirtualHost yy.yy.yy.yy:8080>

    ServerName xxx.com
    ServerAlias www.xxx.com
    ServerAdmin [email protected]
    DocumentRoot /home/xxx/web/xxx.com/public_html
    ScriptAlias /cgi-bin/ /home/xxx/web/xxx.com/cgi-bin/
    Alias /vstats/ /home/xxx/web/xxx.com/stats/
    Alias /error/ /home/xxx/web/xxx.com/document_errors/
    #SuexecUserGroup xxx xxx
    CustomLog /var/log/apache2/domains/xxx.com.bytes bytes
    CustomLog /var/log/apache2/domains/xxx.com.log combined
    ErrorLog /var/log/apache2/domains/xxx.com.error.log
    <Directory /home/xxx/web/xxx.com/public_html>
        AllowOverride All
        Options +Includes -Indexes +ExecCGI
        php_admin_value open_basedir /home/xxx/web/xxx.com/public_html:/home/xxx/tmp
        php_admin_value upload_tmp_dir /home/xxx/tmp
        php_admin_value session.save_path /home/xxx/tmp
    </Directory>
    <Directory /home/xxx/web/xxx.com/stats>
        AllowOverride All
    </Directory>

    <IfModule mod_ruid2.c>
        RMode config
        RUidGid xxx xxx
        RGroups www-data
    </IfModule>
    <IfModule itk.c>
        AssignUserID xxx xxx
    </IfModule>

    IncludeOptional /home/xxxx/conf/web/apache2.xxx.com.conf*

</VirtualHost>
/home/xxx/conf/web/nginx.conf:

Code: Select all

server {
    listen      yy.yy.yy.yy:80;
    server_name xxx.com www.xxx.com;
    error_log  /var/log/apache2/domains/xxx.com.error.log error;

    location / {
        proxy_pass      http://yy.yy.yy.yy:8080;
        location ~* ^.+\.(jpg|jpeg|gif|png|ico|svg|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|odt|ods|odp|odf|tar|wav|bmp|rtf|js|mp3|avi|mpeg|flv|html|htm)$ {
            root           /home/xxx/web/xxx.com/public_html;
            access_log     /var/log/apache2/domains/xxx.com.log combined;
            access_log     /var/log/apache2/domains/xxx.com.bytes bytes;
            expires        max;
            try_files      $uri @fallback;
        }
    }

    location /error/ {
        alias   /home/xxx/web/xxx.com/document_errors/;
    }

    location @fallback {
        proxy_pass      http://yy.yy.yy.yy:8080;
    }

    location ~ /\.ht    {return 404;}
    location ~ /\.svn/  {return 404;}
    location ~ /\.git/  {return 404;}
    location ~ /\.hg/   {return 404;}
    location ~ /\.bzr/  {return 404;}

    include /home/xxx/conf/web/nginx.xxx.com.conf*;
}
Thanks,
vanderheyde

Re: 111: connection refused while connecting to upstream

Posted: Sat Dec 09, 2017 12:22 am
by vanderheyde
Found the issue:

/etc/apache2/conf.d/yy.yy.yy.yy.conf did not contain "listen yy.yy.yy.yy:8080"

Re: 111: connection refused while connecting to upstream [Solved]

Posted: Tue Sep 29, 2020 12:43 pm
by makozazi
Hi,
i have similar issue, I am getting error 500 when i try open any website on my server.
Below is error message from my error log, what can be wrong???

connect() failed (111: Connection refused) while connecting to upstream

Re: 111: connection refused while connecting to upstream [Solved]

Posted: Wed Sep 30, 2020 8:12 am
by thewrongadmin
Also having the same problem, updated the server at some point then restarted later on and all local websites are doing this.