在SSL配置后坚持欢迎使用Nginx

时间:2017-04-26 03:39:52

标签: ssl nginx flask

我按照此tutorial在我的site上安装了SSL。 编辑默认文件后,网站无法正确加载我的页面,如下所示。 知道出了什么问题吗?

等/ nginx的/位点可用/默认

server {
    listen 80 default_server;
    listen [::]:80 default_server;
    server_name nickczj.com www.nickczj.com;
    return 301 https://$server_name$request_uri;

    location ~ /.well-known {
                allow all;
    }

    root /var/www/html;

    index index.html index.htm index.nginx-debian.html;

    server_name _;

    location / {
        try_files $uri $uri/ =404;
    }
}


server {

    # SSL configuration

    listen 443 ssl http2 default_server;
    listen [::]:443 ssl http2 default_server;
    include snippets/ssl-nickczj.com.conf;
    include snippets/ssl-params.conf;

    location ~ /.well-known {
                allow all;
    }

    root /var/www/html;

    index index.html index.htm index.nginx-debian.html;

    server_name _;

    location / {
        try_files $uri $uri/ =404;
    }
}

0 个答案:

没有答案