Skip to main content

Nginx - Solution for 10060: A connection attempt failed because the connected party did not properly respond

I was in the process of setting up Nginx to serve as the reverse proxy for Nexus Repository Manager OSS. However, the Nexus repository started loading really slowly post this and used to repeatedly display disconnected and reconnected messages. The Nginx log file used to log the below error -

<timestamp> [error] 3240#3632: *1 upstream timed out (10060: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond) while connecting to upstream, client: <ip address="">, server: <fqdn>, request: "GET /nexus HTTP/1.1", upstream: "http://[::1]:8081/nexus", host: "<fqdn>"


My nginx.conf for this context path was -
location /nexus {   
proxy_set_header        Host $host:$server_port;    proxy_set_header        X-Real-IP $remote_addr;    proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;   
proxy_set_header        X-Forwarded-Proto $scheme;    proxy_redirect http:// https://;   
proxy_pass http://<fqdn>:8081/nexus; # though this was the same VM, I used FQDN here
}

After spending a significant amount of time, I finally came across a really simple but non-obvious solution here. It was to change proxy_pass to;
proxy_pass http://127.0.0.1:8081/nexus;
Quoting from the linked document -
There might also be an issue when using domain names which are external while you are internal to Nginx, ea. All traffic going out through a router and back in again, use a local DNS (or your ‘host’ file to keep such traffic local) 
Now the Nexus repository does not have any access issues. Loads blazing fast.

Comments

  1. Thank you SO MUCH for this post. I was troubleshooting this for ages. Thanks

    ReplyDelete

Post a Comment

Popular posts from this blog

Resolving INS-20802: Oracle Net Configuration Assistant failed error on Windows 10

I was all excited about the migration to Windows 10 until I had to install Oracle client 12.1.0.2 on it. The Oracle client installation used to fail miserably at the last stage with this error named INS-20802.

Turning off a Dell Laptop Monitor: Keyboard shortcut(s)

I am someone who is particular about power savings and I don't leave appliances powered on when not in use. The same applies to computing devices - be it a smartphone or a PC/Laptop. I power off the desktop monitor when I step out for a tea break or hit Fn+F2 on my Lenovo laptop that turns off the display. Recently, I got a Dell Laptop and I was surprised to discover that Dell does not provide any shortcut to turn off the display. This led to some exploration and I found two ways to achieve that which are outlined below - 

The Mutual Fund Mandate Conundrum

I always use the biller option in net banking to set up mutual fund SIPs. This time I was set to help an elderly gentleman to set up a SIP in a scheme run by UTI Mutual fund and that led me to write this post - one after several months in this blog! He has his savings account with a PSU - Canara Bank and I must say that is one tough bank to deal with. Every update requires a branch visit and they charge for literally everything - even for mobile number and email ID updates, separately. It cost us ₹59/- including GST. Tip : If you are unable to reset your net banking password for Canara Bank due to your date of birth not being registered with them, use the Unix default - 01 January 1970!