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

た 入场券 2024-03-17 20:32 239阅读 0赞

参考文献

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

特别笔记

腾讯各类证书配置文档

nginx配置

  1. server {
  2. listen 7700 ssl;
  3. listen [::]:7700 ssl;
  4. server_name example.com;
  5. #请填写证书文件的相对路径或绝对路径
  6. ssl_certificate /path/to/certificate.crt;
  7. #请填写私钥文件的相对路径或绝对路径
  8. ssl_certificate_key /path/to/private.key;
  9. location / {
  10. proxy_pass http://localhost:6060/;
  11. proxy_redirect http:// https://;
  12. proxy_set_header Host $host:7700;
  13. #proxy_set_header Host $host;
  14. proxy_set_header Upgrade $http_upgrade;
  15. proxy_set_header Connection upgrade;
  16. proxy_set_header Accept-Encoding gzip;
  17. }
  18. }

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

特说说明:

letsencrypt证书说明:

  1. private.pem 密钥, 可更改后缀为key
  2. fullchain.crt 完整证书, 可更改后缀为pem
  3. certificate.pfx IISTomcat使用, 秘钥在detail.txt

发表评论

表情:
评论列表 (有 0 条评论,239人围观)

还没有评论,来说两句吧...

相关阅读

    相关 Nginx 配置 ssl 证书

    > 在部署线下测试环境时浏览器会自动将http替换成https,又因为测试环境没有证书经常会导致跳转错误,所以自己配置一个ssl证书就可以避免这个问题。 > 下面记录我在M