3 回答

TA貢獻1789條經驗 獲得超8個贊
我們通過http://IP:Port/訪問nginx時,出現(xiàn)welcome to nginx的界面,默認這是正常的。這個文件在../nginx/html/index.html。在nginx.conf配置中,明確了這個文件的位置。
location / {
root html;
index index.html index.htm;
}
如果你想修改,可以將這個index.html替換掉。
現(xiàn)在不知道你修改的配置是什么內容,不方便去判定。

TA貢獻1880條經驗 獲得超4個贊
nginx不管怎么修改配置,頁面都是默認頁面welcome to nginx的解決辦法:
現(xiàn)象描述:
在/etc/nginx/nginx.conf中無論怎么配置http,server項,頁面都是默認的,而且啟動nginx不報錯,隨意輸入網(wǎng)址也不報錯(都是welcome to nginx)
分析:
注意/etc/nginx/nginx.conf的http中有沒有
include /etc/nginx/sites-enabled/*;
這句話
如果有,那么再檢查一下語句中的位置,是否有default這個文件,打開看看,原來這里已經有server,location這些定義,而在/etc/nginx/nginx.conf中定義的這些信息卻不能覆蓋先前的。
解決方案:
第一種:注釋掉這行,使其采用nginx.conf中的配置。
第二種:直接修改default中的內容
- 3 回答
- 0 關注
- 8058 瀏覽
添加回答
舉報