在centos的服務器上,沒有啟動php-fcgi。
本來是想設置顯示一個靜態文件目錄的,用不着php,於是就關閉了php-fcgi。
結果打開爆了一個大大的nginx502 bad gateway的錯誤提示
但是nignx的配置文件里面沒有刪除php的內容,刪除掉php的配置。
放一個靜態html的虛擬主機配置
server {
listen 80;
server_name dev.lanmin.top; #改你綁定的域名
charset utf-8;
#不加是不會顯示目錄的
autoindex on;
location / {
root /data/www/html;
index index.html index.htm;
}
}
用nginx -t 檢測配置文件是否OK,successful的話重啟Nginx
nginx -s reload
注意都是root用戶下操作的,請先切換到root.
