访问 https://exmaple.com ,浏览器提示 Your connection is not private 。有解决办法吗?

问答中心分类: OneinStack访问 https://exmaple.com ,浏览器提示 Your connection is not private 。有解决办法吗?
匿名用户 asked 8 年 ago
博主你好,用了oneinstack中的 lnmp,步骤中配置了 exmaple.com 跳转到 http://www.exmaple.com 。在http下能正常跳转。
http://www.exmaple.com 使用了ssl证书(证书可用,https://www.exmaple.com 访问完全正常)
如果使用https://exmaple.com ,浏览器则会先提示 Your connection is not private ,强行访问(浏览器提示unsafe的那个选项),就跳转到 https://www.exmaple.com。
有没有什么办法,能让浏览器不提示吗? https 的重定向,不懂啊……

3 Answers
oneinstack answered 8 年 ago
https下  exmaple.com域名绑定了吗?

匿名用户 answered 8 年 ago
域名绑定, 是指什么?
贴下nginx 配置文件:
server {
listen 443 ssl http2;
ssl_certificate /etc/letsencrypt/live/www.exmaple.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/www.exmaple.com/privkey.pem;
ssl_session_timeout 10m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_ciphers ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-RC4-SHA:ECDHE-RSA-AES256-SHAHE-RSA-AES256-SHAHE-RSA-AES128-SHA:RC4-SHA:!aNULL:!eNULL:!EXPORT:!DES:!3DES:!MD5:!DSS:!PKS;
ssl_session_cache builtin:1000 shared:SSL:10m;
resolver 8.8.8.8 8.8.4.4 valid=300s;
resolver_timeout 5s;
server_name http://www.exmaple.com;
access_log /data/wwwlogs/www.exmaple.com_nginx.log combined;
index index.html index.htm index.php;
include /usr/local/nginx/conf/wordpress.conf;
root /data/wwwroot/www.exmaple.com;
if ($host != http://www.exmaple.com) {
    rewrite ^/(.*)$ $scheme://www.exmaple.com/$1 permanent;
    }
location ~ .*\.(wma|wmv|asf|mp3|mmf|zip|rar|jpg|gif|png|swf|flv)$ {
    valid_referers none blocked *.exmaple.com http://www.exmaple.com exmaple.com;
    if ($invalid_referer) {
        #rewrite ^/ http://www.linuxeye.com/403.html
        return 403;
        }
    }
location ~ [^/]\.php(/|$) {
    #fastcgi_pass remote_php_ip:9000;
    fastcgi_pass unix:/dev/shm/php-cgi.sock;
    fastcgi_index index.php;
    include fastcgi.conf;
    }
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|ico)$ {
    expires 30d;
    access_log off;
    }
location ~ .*\.(js|css)?$ {
    expires 7d;
    access_log off;
    }
}
server {
listen 80 default;
server_name http://www.exmaple.com;
rewrite ^/(.*) https://$server_name/$1 permanent;
}
 

oneinstack answered 8 年 ago
server_name http://www.exmaple.com; 改成 server_name http://www.example.com example.com;