• The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

502 Bad Gateway errors after upgrading to Plesk 12.0.18

danielmt2k

New Pleskian
Hi,

Yesterday I've upgraded the server to Plesk 12.0.18. After the upgrade, a WHMCS install has stopped working.

The only error logs where I found errors is the proxy_error_log. It contains this kind of lines (for the 502 error):

2014/08/13 08:13:45 [error] 2918#0: *400 upstream prematurely closed connection while reading response header from upstream, client: XX.XX.XX.XX, server: XXXXXXX.COM, request: "GET /knowledgebase.php HTTP/1.1", upstream: "http://XX.XX.XX.XX:7080/knowledgebase.php", host: "xxxxxxxxx.com"

Any idea how to fix it?

Thanks.
 
Since you upgraded to Plesk 12.0.18, you have a proxy - server called "nginx" installed as well. You might not like the idea in the first place, to configure another thing, to keep sites with rewrite - rules running as they did before, but you will soon discover ( after the configuration is done ^^ ), that nginx can handle some php-sites much faster.

In your domain hosting - settings, you have the possibility, to add some "custom" definitions for a domain. So IF you use rewrite - rules, which you normally put in a ".htaccess" - file, you now have to put these rewrite - rules in these custom vhost - configuration - - - but keep in mind, that htaccess - rules MUST be changed for nginx, because nginx handles them in another way. A nice online tool would be here: htaccess to nginx converter , but you find the best solutions by reading the documentation for nginx and WHMCS here: http://docs.whmcs.com/Support_Center#Nginx

In Plesk - Panel, go to your domain and choose the options for "Webserver settings" - scroll down to the Editor and paste the following suggestion from WHMCS:
Code:
# Announcements
rewrite ^/announcements/([0-9]+)/[a-zA-Z0-9-]+\.html$ /./announcements.php?id=$1 last;
rewrite ^/announcements$ /./announcements.php last;
 
# Downloads
rewrite ^/downloads/([0-9]+)/([^/]*)$ /./downloads.php?action=displaycat&catid=$1 last;
rewrite ^/downloads$ /./downloads.php last;
 
#Knowledgebase
rewrite ^/knowledgebase/([0-9]+)/[a-zA-Z0-9-]+\.html$ /./knowledgebase.php?action=displayarticle&id=$1 last;
rewrite ^/knowledgebase/([0-9]+)/([^/]*)$ /./knowledgebase.php?action=displaycat&catid=$1 last;
rewrite ^/knowledgebase$ /./knowledgebase.php last;

Please don't disable ioncube loader, because it secures your website ( your php-sites and scripts ). It isn't responsible for rewrite - rules issues.
If you still experience problems, after you changed your webserver settings, please let us know, so we could help you with other decent solutions.
 
Hi,
Thx for your answer.
First i have to say we already used Nginx with plesk 11.5 and know it.

The problem is in Nginx setup, we did not enable process of php files.
So normally Nginx handle only static files and apache handle php files.
So i'm not sure it is a rewrite problem.

About your answer i have to say 2 things :
First : disable ioncube cause no problem if there is no ioncube encrypted scripts ... Ioncube only secure something already encrypted with ioncube ! And if you disable it encrypted scripts will simply don't work !
Second : Setup code you give only rewrite some files named, or in folder named, "announcements", "downloads" or "knowledgebase" ... No link with my problems.


Regards.
 
Last edited:
Back
Top