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
Featured Photo 攝影師:nanoom,連結:Pixabay