Nginx重定向在chrome上失败,但可在其他浏览器上使用

时间:2019-06-09 01:10:55

标签: laravel google-chrome ubuntu nginx

我正在尝试将确认的电子邮件重定向到主机(我强迫http重定向到https),但是这在除chrome之外的所有浏览器中都有效……最初我刷新了dns,但这并不能永久解决...

我尝试重写我的Nginx服务器,但是仍然收到email.mysite.com花费了很长时间才能响应。但是它在除chrome之外的所有浏览器上都有效

 server {
        listen 80;
        server_name mysite.com www.mysite.com email.mysite.com;
        return 301 https://www.$server_name$request_uri;
    }
    server {
        listen 443 ssl http2;
        server_name mysite.com email.mysite.com;
        #ssl on;
        ssl_certificate     /etc/letsencrypt/live/mysite.com-0001/fullchain.pem;
            #ssl_certificate  /etc/letsencrypt/live/email.mysite.com/fullchain.p$
        ssl_certificate_key     /etc/letsencrypt/live/mysite.com-0001/privkey.pe$
            #ssl_certificate_key /etc/letsencrypt/live/email.mysite.com/privkey.$
        return 301 https://www.$server_name$request_uri;
    }
    server {
        listen 443 ssl http2;
        server_name www.mysite.com;
        include snippets/pagespeed.conf;
        include snippets/optimizations.conf;
        access_log /var/log/nginx/mysite.com.access.log rt_cache;
        error_log /var/log/nginx/mysite.com.error.log;

        root /var/www/html/site/public;
        index index.php index.html index.htm;

    # add_header Strict-Transport-Security max-age=15768000;
            add_header Strict-Transport-Security "max-age=31536000; includeSubdomains";
        #ssl on;
        ssl_certificate     /etc/letsencrypt/live/mysite.com-0001/fullchain.pem;
        ssl_certificate_key     /etc/letsencrypt/live/mysite.com-0001/privkey.pem;

        location / {
            try_files $uri $uri/ /index.php$is_args$args;
        }


    }

email.mysite.com应该在Chrome中加载,因为它已在所有浏览器中加载

0 个答案:

没有答案