Opened 4 years ago

Closed 4 years ago

#1944 closed defect (invalid)

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

Reported by: mmuhammadeuss@… Owned by:
Priority: major Milestone: nginx-1.17
Component: documentation Version: 1.17.x
Keywords: 504 timeout error Cc: mmuhammadeuss@…
uname -a: Linux serveur 3.10.0-1062.12.1.el7.x86_64 #1 SMP Tue Feb 4 23:02:59 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
nginx -V: nginx version: nginx/1.17.7
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-39) (GCC)
built with OpenSSL 1.0.2k-fips 26 Jan 2017
TLS SNI support enabled
configure arguments: --prefix=/opt/nginx --add-module=/root/naxsi-master/naxsi_src/ --user=nginx --group=nginx --with-http_ssl_module --with-http_geoip_module --without-mail_pop3_module --without-mail_smtp_module --without-mail_imap_module --without-http_uwsgi_module --without-http_scgi_module

Description

Hi Team
I'm experiencing 504 timeout error when accessing a JSP file in a directory (https://example.com/dev/index.jsp). The logs simply says this:

[error] 1840#0: *16408115 connect() failed (111: Connection refused) while connecting to upstream, client: 192.168.15.5, server: 192.168.15.4, request: "GET /dev/index.jsp?error=%20not HTTP/1.1", upstream: "https://192.168.15.3:443//index.jsp?error=%20not"

I've never experienced this before. What is the solution for this type of 504 timeout error?

This is the nginx.conf:

user nginx;
worker_processes 1;
events {

worker_connections 1024;

}
http {

include /opt/nginx/conf/mime.types;
include /opt/nginx/conf/naxsi_core.rules;
default_type application/octet-stream;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
sendfile on;
keepalive_timeout 65;
tcp_nodelay on;
gzip on;
gzip_disable "MSIE [1-6].(?!.*SV1)";

server {

listen 8081;
server_name 192.168.15.4;
access_log off ;
error_log off ;

location /RequestDenied {

return 403;

}

error_page 403 /403_error.html;

location = /403_error.html {

root /usr/share/nginx/html;
internal;

}

}

server {

listen 443 ssl;
server_name 192.168.15.4;
access_log /var/log/nginx/access.log;
error_log off ;
ssl_certificate /etc/ssl/certs/cert.crt;
ssl_certificate_key /etc/ssl/private/keyy.key;


error_page 403 /403_error.html;

location = /403_error.html {

root /usr/share/nginx/html;
internal;

}

error_page 404 /404_error.html;

location = /404_error.html {

root /usr/share/nginx/html;
internal;

}

location /dev/

{
include /opt/nginx/conf/naxsi.rules;

rewrite /dev(.*) /$1 break;

proxy_connect_timeout 600;
proxy_send_timeout 600;
proxy_read_timeout 600;
send_timeout 600;

proxy_pass https://192.168.15.3:443;

}

I've never experienced this before. What is the solution for this type of 504 timeout error?

Change History (1)

comment:1 by Maxim Dounin, 4 years ago

Resolution: invalid
Status: newclosed

The error message suggests that there is a problem with your upstream server, likely it is not running or overloaded. The message in question is expected to result in 502 error rather than 504, though clearly it's related anyway.

This doesn't look like a bug in nginx, so closing this. If you need further help, consider using support options available.

Note: See TracTickets for help on using tickets.