Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

231
Views
nginx 30 seconds 502 error timeout after proxy restart

I have many nodejs proxies running behind nginx, it has worked fine for years with 1 annoying exception.

When the nodejs process is restarted, the client receives a 502 error, which is OK, however nginx appears to continue refusing the connection for exactly 30 seconds, and then the connection is restored.

I need to reduce this down to a few seconds, I have seen other posts about increasing timeouts to overcome intermittent gateway errors, however this is different.

I have tried enabling keep-alive with:

  proxy_http_version 1.1;
  proxy_set_header Connection "";

But that has no effect.

Does anyone know which parameter is controlling this 30 second timeout ?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

OK, solved:

proxy_cache_valid 502 5s;

This appears to reduce the time that the server waits after a 502 error before restoring the connection.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!