这里是我的服务器设置域引导到nginx的默认页面,而不是我的根
/etc/nginx/sites-available/example.com
server {
listen 80;
server_name example.com www.example.com
root /root/sites/example.com;
index index.html;
}
server {
listen 80;
server_name subdomain.example.com www.subdomain.example.com;
location /static {
alias /var/www/subdomain.example.com/static;
}
location/{
proxy_set_header HOST $host;
proxy_pass http://127.0.0.1:5000;
}
}
subdomain.example.com
工作正常。但是当我去example.com
那么它显示nginx的默认欢迎页面。
注:我删除/etc/nginx/sites-enabled/default
需要帮助解决它。
/root/sites/example.com的内容是什么?您在启用网站时有什么功能? – 2014-12-06 15:49:11
这是一个简单的html网站。 'example.com'包含'index.html'和其他'css'文件。 'sites-enabled'有一个文件'examplme.com',它符号链接到'sites-available/example.com'。 'sites-enabled'中没有其他文件。我删除了'sites-enabled/default',但不是'sites-available.default'。 – 2014-12-06 16:46:17