Bad gateway Error code 502 when delete and re-create website
2026-03-10 06:11:33
#1

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.

Image

How to reproduce

  • delete a website

  • re-create exactly same website name

Source: https://github.com/cloudpanel-io/cloudpanel-ce/issues/738

2026-03-10 06:14:54
#2

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:

systemctl restart nginx
systemctl restart php*-fpm

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

Yazdığımız şeyler bizi temsil eder, Efendilik iyidir.
Please Login or Register.
Currently 1 people reading this topic. (1 guest(s))