求助:IP地址已安装SSL证书,依旧提示“不安全”,找不出原因,怎么办?

进度现状:


1. 已参考始皇的教程佬友的攻略申请了SSL证书:




2. 按照ZeroSSL教程将证书上传安装:


3. 参考了Datart官方文档的说明,修改了nginx,配置如下:

备注

排查时发现,操作中有个不一样的地方是:dataease的官方说明书是用vim nginx.conf 进入编辑,而我是按AI的指引,用sudo nano /etc/nginx/sites-available/default,进行编辑的。但后续复查中,AI说这样是OK的


4. 但最终连接时,还是提示不安全:


如果我在网址中强制写上 https:// 就会提示: ERR_SSL_PROTOCOL_ERROR


问了几个AI模型,排查了N遍,换了N种建议的配置,依旧没解决。。。。





已经懵圈,不知道问题到底出在哪里?

特来求助各位佬友~~~ :lark_048:

9 个赞

前排 坐等大佬的解答

3 个赞

换个浏览器,有时是缓存没清掉,换个没访问过这个域名的浏览器试一下

3 个赞

谢谢!立马去试了下,换了个浏览器,还是会提示不安全

2 个赞

nginx -t 了么?

1 个赞

nignx 进程 退掉, 再启动!

2 个赞

浏览器不一定会内置zerossl的根证书

1 个赞

嗯嗯,之前按这样操作过的

已经用 sudo systemctl restart nginx 重启过了

1 个赞

也有可能是 你的证书和你的域名不匹配

2 个赞

咦,这是个很新奇的角度!我去安装试试

1 个赞

SSL Checker 给出了什么结果?

1 个赞

是按照指定IP去申请的,复查了好几遍的

还有这个工具啊,我去查查看哈,谢谢佬

小白建议用nginx proxy manager面板可视化申请,自己用nginx的话容易出错

1 个赞

刚去查了一下,是有根证书的

提示没有查到SSL证书

我成功的配置文件, 你看看你的配置对吗


#user  nobody;
worker_processes  1;

#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;

#pid        logs/nginx.pid;


events {
    worker_connections  1024;
}


http {
    include       mime.types;
    default_type  application/octet-stream;

    #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
    #                  '$status $body_bytes_sent "$http_referer" '
    #                  '"$http_user_agent" "$http_x_forwarded_for"';

    #access_log  logs/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;

    gzip  on;

    server {
        listen 443 ssl;
        server_name localhost;   #证书绑定的网站域名

        #ssl证书的pem文件路径
        ssl_certificate  /etc/nginx/cert/ip/certificate.crt;
        #ssl证书的key文件路径
        ssl_certificate_key /etc/nginx/cert/ip/private.key;
        charset UTF-8;

        location / {
            root   /var/www;
            try_files $uri $uri/ /index.html;
            index  index.html index.htm;
        }
        location /.well-known/pki-validation/6E066233196EA0BEF81215C360FFBCFA.txt {
            alias /var/www/pki-validation/6E066233196EA0BEF81215C360FFBCFA.txt;
        }

    }

    server {
        listen 80;	#监听ipv4
        listen [::]:80;	#监听ipv6
        server_name localhost;	#虚拟主机域名
        rewrite ^(.*)$ https://$host$1 permanent;	#rewrite跳转





        #error_page  404              /404.html;

        # redirect server error pages to the static page /50x.html
        #
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }

        # proxy the PHP scripts to Apache listening on 127.0.0.1:80
        #
        #location ~ \.php$ {
        #    proxy_pass   http://127.0.0.1;
        #}

        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
        #
        #location ~ \.php$ {
        #    root           html;
        #    fastcgi_pass   127.0.0.1:9000;
        #    fastcgi_index  index.php;
        #    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
        #    include        fastcgi_params;
        #}

        # deny access to .htaccess files, if Apache's document root
        # concurs with nginx's one
        #
        #location ~ /\.ht {
        #    deny  all;
        #}
    }


    # another virtual host using mix of IP-, name-, and port-based configuration
    #
    #server {
    #    listen       8000;
    #    listen       somename:8080;
    #    server_name  somename  alias  another.alias;

    #    location / {
    #        root   html;
    #        index  index.html index.htm;
    #    }
    #}


    # HTTPS server
    #
    #server {
    #    listen       443 ssl;
    #    server_name  localhost;

    #    ssl_certificate      cert.pem;
    #    ssl_certificate_key  cert.key;

    #    ssl_session_cache    shared:SSL:1m;
    #    ssl_session_timeout  5m;

    #    ssl_ciphers  HIGH:!aNULL:!MD5;
    #    ssl_prefer_server_ciphers  on;

    #    location / {
    #        root   html;
    #        index  index.html index.htm;
    #    }
    #}

}

刚想说npm,这个真的挺方便,唯一缺点就是npm意外终止了要重新启动

我建议使用一些可视化的面板来进行绑定ssl证书,比较省事不容易出错