Reverse proxy 502 bad gateway

1

2

I have setup a subdomain to proxy my plesk panel, but when saving pages I am getting 502 Bad Gateway error instead of a completion message. I am running CentOS 6.

Here is my vhost.conf configuration for http://plesk.domain.tld/:

RewriteEngine On
RewriteCond %{SERVER_PORT} ^80$
RewriteRule $ https://plesk.domain.tld/ [R,L]

Here is my vhost_ssl.conf configuration for https://plesk.domain.tld/:

SSLProxyEngine On

<Location />
    ProxyPass https://localhost:8443/
    ProxyPassReverse https://localhost:8443/
</Location>

I have more than enough (and I have even checked) RAM, CPU and HDD. There are no spikes. As well, the posted information does save, it just errors when trying to show me a "This information has been saved." green/red block.

Here is the relevent error from /var/log/nginx/error.log (IP/Host Filtered):

2014/05/29 02:42:41 [error] 8046#0: *402 upstream prematurely closed connection while reading response header from upstream, client: 173.238.XX.XX, server: plesk.domain.tld, request: "POST /smb/web/edit HTTP/1.1", upstream: "https://198.100.XX.XX:7081/smb/web/edit", host: "plesk.domain.tld", referrer: "https://plesk.domain.tld/smb/web/edit"

Brian Graham

Posted 2014-05-29T01:10:55.857

Reputation: 345

Answers

1

For those looking to fix this problem, here is the solution.

Reference: https://support.plesk.com/hc/en-us/articles/213907285-How-to-enable-disable-graceful-restart-for-Apache-

By default, Parallels Plesk Panel does not use Apache graceful restart for applying new settings. As result Apache will be restarted every time you change hosting settings through the Plesk GUI. This can lead to unwanted interruptions of sites operation.

Solution

INSERT INTO `misc` VALUES ('restart_apache_gracefully', 'true') ON DUPLICATE KEY UPDATE `val` = 'true';

Brian Graham

Posted 2014-05-29T01:10:55.857

Reputation: 345

plesk kb link is dead. – sjas – 2018-05-14T12:53:02.440

@sjas fixed the link – Brian Graham – 2018-05-14T13:08:51.803