Bad gateway Error code 502 when delete and re-create website

CLPGithub

New member
When delete a website and re-create exactly same website name, I got error Bad gateway Error code 502, I didn't change any settings or cloudflare settings, and the previous site still online.



How to reproduce​


  • delete a website
  • re-create exactly same website name

Source: https://github.com/cloudpanel-io/cloudpanel-ce/issues/738
 
This usually happens because when the site is deleted and recreated with the same domain, Nginx or PHP-FPM may still be using the old configuration or socket, so Cloudflare cannot get a valid response from the origin server and returns a 502 Bad Gateway error. In most cases, simply restarting the services fixes the issue:

Code:
systemctl restart nginx
systemctl restart php*-fpm

You can also run nginx -t to check the configuration and then systemctl reload nginx if needed.
 
Back
Top