Nginx 虚拟主机文件不工作
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;
}
}
我有一个超级简单的 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;
}
}