宝塔配置SSL证书

2022-12-10 14:16:45 浏览数 (1)

添加一个配置文件

代码语言:javascript复制
 cd /www/server/panel/vhost/nginx

创建一个文件 kibana.zanglikun.com.conf

代码语言:javascript复制
server {
    listen 80;
    listen 443 ssl http2;
    server_name kibana.zanglikun.com;
    
    #SSL-START SSL相关配置,请勿删除或修改下一行带注释的404规则
    #error_page 404/404.html;
    ssl_certificate    /www/server/panel/vhost/cert/kibana.zanglikun.com/fullchain.pem;
    ssl_certificate_key    /www/server/panel/vhost/cert/kibana.zanglikun.com/privkey.pem;
    ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3;
    ssl_ciphers EECDH CHACHA20:EECDH CHACHA20-draft:EECDH AES128:RSA AES128:EECDH AES256:RSA AES256:EECDH 3DES:RSA 3DES:!MD5;
    ssl_prefer_server_ciphers on;
    ssl_session_cache shared:SSL:10m;
    ssl_session_timeout 10m;
    add_header Strict-Transport-Security "max-age=31536000";
	#SSL-END
    
    error_page 502 404 /home/myoutput/hertzbeat/404.html;
    
    location / {
         proxy_pass http://127.0.0.1:35601/;
         proxy_set_header Host $proxy_host;
    	    proxy_set_header X-Real-IP $remote_addr;
    	    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }
}

添加SSL证书 pem文件,填写完成后,修改后缀为pem

代码语言:javascript复制
vim /www/server/panel/vhost/cert/kibana.zanglikun.com/fullchain.txt

添加SSL证书 key文件,填写完成后,修改后缀为pem

代码语言:javascript复制
vim /www/server/panel/vhost/cert/kibana.zanglikun.com/privkey.txt

重启Nginx即可

特殊说明: 以上文章,均是我实际操作,写出来的笔记资料,不会盗用别人文章!烦请各位,请勿直接盗用!转载记得标注来源!

0 人点赞