使用的是阿里云免费DV证书,单个域名

1.下载ssl审核通过的证书 使用nginx版本

oneinstack Java环境 Nginx安装ssl证书 (LNMT : Linux + Nginx+ MySQL/MongoDB+ Tomcat)

 

 oneinstack Java环境 Nginx安装ssl证书 (LNMT : Linux + Nginx+ MySQL/MongoDB+ Tomcat)

 

 

 

2.nginx 文件配置 和 证书存放

 oneinstack Java环境 Nginx安装ssl证书 (LNMT : Linux + Nginx+ MySQL/MongoDB+ Tomcat)

 

oneinstack Java环境 Nginx安装ssl证书 (LNMT : Linux + Nginx+ MySQL/MongoDB+ Tomcat)

 

 

server {
  listen 80;
  listen [::]:80;
    listen 443 ssl;
    ssl_certificate cert/3919775_video.xiaoxiao.cool.pem;
    ssl_certificate_key cert/3919775_video.xiaoxiao.cool.key;
       
  server_name video.xiaoxiao.cool;
  access_log /data/wwwlogs/video.xiaoxiao.cool_nginx.log combined;
  index index.html index.htm index.jsp;
  root /data/wwwroot/video.xiaoxiao.cool;
   #自动跳转
     if($server_port = 80 ){
          rewrite ^(.*)$ https://$host$1 permanent;
     }
  #error_page 404 /404.html;
  #error_page 502 /502.html;
  
  location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|mp4|ico)$ {
    expires 30d;
    access_log off;
  }
  location ~ .*\.(js|css)?$ {
    expires 7d;
    access_log off;
  }
  location ~ /(\.user\.ini|\.ht|\.git|\.svn|\.project|LICENSE|README\.md) {
    deny all;
  }
  location ~ {
    proxy_pass http://127.0.0.1:8080;
    include proxy.conf;
  }
}

 

 

证书存放路径

oneinstack Java环境 Nginx安装ssl证书 (LNMT : Linux + Nginx+ MySQL/MongoDB+ Tomcat)

 

 

 

 配置好reload一下,就完成了

service nginx reload

 

相关文章:

  • 2021-12-21
  • 2021-05-22
  • 2021-08-21
  • 2022-02-09
  • 2021-12-26
  • 2021-11-28
猜你喜欢
  • 2022-12-23
  • 2021-11-12
  • 2021-05-20
  • 2021-10-28
  • 2021-10-26
  • 2021-07-06
  • 2022-02-05
相关资源
相似解决方案