NGINX – 502 Bad Gateway


502 Bad Gateway 錯誤是在 Nginx 系統中最常見的錯誤,原因比較多,是因為在代理模式下後端主機出現問題引起的,也非常不好處理。

我這個錯誤是在一台 VPS 上 sudo apt-get update 之後產生,升級過程中有一段更新:

Configuration file `/etc/php5/fpm/pool.d/www.conf'
 ==> Modified (by you or by a script) since installation.
 ==> Package distributor has shipped an updated version.
   What would you like to do about it ?  Your options are:
    Y or I  : install the package maintainer's version
    N or O  : keep your currently-installed version
      D     : show the differences between the versions
      Z     : start a shell to examine the situation
 The default action is to keep your current version.
*** www.conf (Y/I/N/O/D/Z) [default=N] ?

很手殘的輸入「Y」,更新了 EasyEngine 的 www.conf 文件,造成全部的網站開啟後,變成 502 Bad Gateway。




sudo service php5-fpm start

清除 PHP

ee stack purge --php

重新安裝一次 PHP

ee stack install --php
hosted by kinsta



發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *

Your Mastodon Instance