• We value your experience with Plesk during 2024
    Plesk strives to perform even better in 2025. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2024.
    Please take this short survey:

    https://pt-research.typeform.com/to/AmZvSXkx
  • 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.

Issue 502 Bad Gateway

Kingsley

Silver Pleskian
Hello;

I am having 502 Bad Gateway error when testing payment on my whmcs install. i use FPM application serve by Apache with PHP7.0.19.

proxy error log

Code:
2017/05/31 22:10:48 [error] 19763#0: *11359 upstream prematurely closed connection while reading response header from upstream, client: 169.159.70.99, server: sproutserver.com, request: "GET /members/modules/gateways/callback/paystack.php?invoiceid=13&trxref=13_1496264982 HTTP/2.0", upstream: "https://158.69.251.21:7081/members/modules/gateways/callback/paystack.php?invoiceid=13&trxref=13_1496264982", host: "sproutserver.com", referrer: "https://sproutserver.com/members/viewinvoice.php?id=13"
2017/05/31 22:10:49 [error] 19763#0: *11359 connect() failed (111: Connection refused) while connecting to upstream, client: 169.159.70.99, server: sproutserver.com, request: "GET /favicon.ico HTTP/2.0", upstream: "https://158.69.251.21:7081/favicon.ico", host: "sproutserver.com"

When i change to FPM application serve by nginx i get 404 error for both wordpress and whmcs
 
1.You have to increase you PHP execution time.

2. .htaccess is not supported when you served by nginx.. so you have to recreate rewrite rules in nginx way.
 
1.You have to increase you PHP execution time.

2. .htaccess is not supported when you served by nginx.. so you have to recreate rewrite rules in nginx way.

PHP execution time is already 1800sec
how do i get the rewrite rule to work?
 
The only way to get my installation to work NGINX was PHP5.6 with FPM. Anything PHP7 and above with NGINX, FPM, FastCGI, or Apache combination would not work. If anyone has been able to get this to work, please post ASAP. Thanks!
 
The only way to get my installation to work NGINX was PHP5.6 with FPM. Anything PHP7 and above with NGINX, FPM, FastCGI, or Apache combination would not work. If anyone has been able to get this to work, please post ASAP. Thanks!

This is an indication that the script is using a PHP function that is no longer supported in PHP 7 or newer. When this is used in combination with AJAX, it leads to the 502 error, because a response to a request is never received by Nginx as PHP does not finish the PHP request. If error messages and logging are turned off this will also happen in regular (non AJAX) requests. I guess that the only proper way to ensure operatability is to update the script and replace all deprecated PHP functions by current functions.
 
Back
Top