Q:不管nginx怎么配置
http,server,打開指定域名總是默認的 welcome to nginx 頁面;
分析
注意到nginx.conf中有一段include /etc/nginx/sites-enabled/*;
問題就在這,打開這個目錄,里面會有一個default文件,打開它,一切都會明了……
原來這里已經(jīng)有了server,location的配置好了默認值,而且是不能被覆蓋的;
解決方案:
- 第一,可以注釋掉
nginx.conf中的include /etc/nginx/sites-enabled/*;。 - 第二,可以直接修改
default
我配置的域名是 documents.wang,訪問有效!