Nginx配置允许在没有www的情况下访问域名

时间:2018-05-02 13:31:07

标签: python django nginx digital-ocean

我在Digital Ocean上部署了一个Django应用程序。我的nginx配置设置与此非常相似(取自here):

server {
    listen 80;
    server_name example.com www.example.com;

    location = /favicon.ico { access_log off; log_not_found off; }

    location /static/ {
            alias /root/djtrump/static/;
    }

    location / {
            include proxy_params;
            proxy_pass http://www.example.com:8030;
    }
}

问题在于 www.example.com会占用我的网站,而example.com则不会。浏览器中显示的错误是无法访问网站

可能的错误和解决问题的必要配置是什么?

0 个答案:

没有答案
相关问题