zoukankan      html  css  js  c++  java
  • oneinstack Java环境 Nginx安装ssl证书 (LNMT : Linux + Nginx+ MySQL/MongoDB+ Tomcat)

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

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

     

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

     

    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;
      }
    }

    证书存放路径

     配置好reload一下,就完成了

    service nginx reload

  • 相关阅读:
    蜘蛛禁止访问文件
    基于PhalApi的Smarty拓展 (视图层的应用)
    MySQL数据库存表情
    查看PHP版本等相关信息
    读取数据库表信息
    nginx简介
    Redis发布订阅
    Redis持久化
    Redis主从复制
    Redis的Java客户端Jedis
  • 原文地址:https://www.cnblogs.com/SeaWxx/p/10716860.html
Copyright © 2011-2022 走看看