[英]Nginx vhost file not working
我有一個應該能正常工作的超級簡單的nginx虛擬主機。 我已經研究了好幾個小時,但我實在很茫然,沒有理由不起作用。 我正在使用17.04 ubuntu和最新的nginx,
server {
listen 80;
server_name utig.me;
access_log /var/www/html/utig/logs/access.log;
error_log /var/www/html/utig/logs/error.log;
location / {
root /var/www/html/utig/public/;
index index.html;
}
}
有人知道為什么這行不通嗎? 我只是得到默認的“ Welcome to nginx”消息。
嘗試這樣:
server {
listen 80;
server_name utig.me;
root /var/www/html/utig/public/;
index index.html;
access_log /var/www/html/utig/logs/access.log;
error_log /var/www/html/utig/logs/error.log;
location / {
try_files $uri $uri/ /index.html;
}
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.