zoukankan      html  css  js  c++  java
  • https的配置

    nginx 配置全站 https
    
    1 . 在nginx目录下创建cert目录
    
    拷贝下面2个文件到cert目录下
    
    证书文件: xxx.pem
    证书私钥; xxx..key
    2 . 修改虚拟主机配置文件
    
    server {
    
        //--- 80 端口改为 443 ssl
        # listen 80;
        listen  443 ssl;
        //--- 80 端口改为 443 ssl
    
        server_name  www.ktvll.com;
        index index.html index.htm index.php;
        root /www/ktvll;
        include /alidata/www/ktvll/.htaccess;
    
        //-----------新增 https 部分----------------
        ssl_certificate      /nginx/cert/21431193.pem;
        ssl_certificate_key  /nginx/cert/21431193.key;
        ssl_session_timeout 5m;
        ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
        ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
        ssl_prefer_server_ciphers on;
        //-----------新增 https 部分----------------
    
        location ~ .php {
            fastcgi_pass  127.0.0.1:9000;
            fastcgi_index index.php;
            include fastcgi.conf;
            fastcgi_split_path_info ^(.+.php)(.*)$;
            fastcgi_param PATH_INFO $fastcgi_path_info;
        }
    
        location ~ .*.(gif|jpg|jpeg|png|bmp|swf)$
        {
            expires 30d;
        }
    
        location ~ .*.(js|css)?$
        {
            expires 1h;
        }
    
        access_log  /alidata/log/nginx/access/default.log;
        autoindex    off;
        error_page 404 = index.php;
    
    }
    
    
    # HTTP 全部跳转到 HTTPS
    server {
        listen 80;
        server_name www.ktvll.com;
        return 301 https://$server_name$request_uri;
    }
    

      

  • 相关阅读:
    Rhythmbox中文乱码解决的方法
    苟富贵勿相忘
    C++“窗体”程序设计启蒙
    Java模式(适配器模式)
    sql server 2005 32位+64位、企业版+标准版、CD+DVD 下载地址大全
    STL学习小结
    Spring3.0 AOP 具体解释
    图解iPhone开发新手教程
    已有路由器为何还要交换机
    路由器功能
  • 原文地址:https://www.cnblogs.com/xin-jun/p/9081383.html
Copyright © 2011-2022 走看看