502 Bad Gateway error is shown while accessing password-protected directory: upstream prematurely closed connection

Created:

2016-11-16 12:41:37 UTC

Modified:

2017-08-16 16:57:34 UTC

3

Was this article helpful?


Have more questions?

Submit a request

502 Bad Gateway error is shown while accessing password-protected directory: upstream prematurely closed connection

Applicable to:

  • Plesk 10.x for Windows
  • Plesk for Linux
  • Plesk 11.x for Linux

Symptoms

While accessing a protected directory in a web browser, it fails with 502 Bad Gateway error after entering the login and password.

2013/07/31 23:59:27 [error] 3671#0: *209872 upstream prematurely closed connection while reading response header from upstream, 
client: 10.20.30.40, server: example.com, request: "GET /download/debian/ HTTP/1.1", upstream: "http://10.20.30.40:7080/download/debian/",
host: "example.com"

Cause

This failure occurs due to timeout.

Resolution

  1. Add the following lines to /etc/nginx/nginx.conf :

    http{
    ...
    fastcgi_buffers 8 128k;
    fastcgi_buffer_size 256k;
    ...
    }
  2. Restart Nginx service:

    ~# service nginx restart
Have more questions? Submit a request
Please sign in to leave a comment.