[运维|ssl证书配置] nginx配置https证书

参考文献

Nginx 服务器 SSL 证书安装部署
Nginx配置SSL证书
在Nginx或Tengine服务器安装SSL证书

特别笔记

腾讯各类证书配置文档

nginx配置

server {
    listen 7700 ssl;
    listen [::]:7700 ssl;
    server_name example.com;

    #请填写证书文件的相对路径或绝对路径
    ssl_certificate /path/to/certificate.crt; 
    #请填写私钥文件的相对路径或绝对路径
    ssl_certificate_key /path/to/private.key; 
     
    location / {
      proxy_pass http://localhost:6060/;
      proxy_redirect http:// https://;
      proxy_set_header Host $host:7700;
      #proxy_set_header Host $host;
      proxy_set_header Upgrade $http_upgrade;
      proxy_set_header Connection upgrade;
      proxy_set_header Accept-Encoding gzip;
    }
}

上述端口配置的是7700端口作为ssl端口

特说说明:

letsencrypt证书说明:

private.pem 密钥, 可更改后缀为key
fullchain.crt 完整证书, 可更改后缀为pem
certificate.pfx IIS和Tomcat使用, 秘钥在detail.txt中

猜你喜欢

转载自blog.csdn.net/macaiyun0629/article/details/131744476