• 腾讯云Nginx配置HTTPS


    1. 获取证书

      腾讯云->SSL证书管理->申请、下载证书,放到nginx的conf文件夹下

    2.修改nginx.conf

      

    # 监听80端口HTTP请求,全部跳转到HTTPS
    server {
            listen       80;
            if ($host = "www.xjcode.com"){
                    return 302 https://www.xjcode.com$request_uri;
            }
            return 302 https://$host$request_uri;
    }
    

      

    server {
            listen       443;
            server_name  xxx.xxx.com;
    
            ssl          on;
            ssl_certificate 1_xxx.xjcode.com_bundle.crt;
            ssl_certificate_key 2_xxx.xjcode.com.key;
            ssl_session_timeout 5m;
            ssl_protocols TLSv1 TLSv1.1 TLSv1.2; #按照这个协议配置
            ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE; #按照这个套件配置
            ssl_prefer_server_ciphers on;
    
            root /www/xxx/public;
            location / {
                 index  index.php index.html index.htm;
                 try_files $uri https://$host$1/ /index.php?$query_string;
            }
    
            error_page   500 502 503 504  /50x.html;
            location = /50x.html {
                root   html;
            }
    
            location ~ .php$ {
                fastcgi_pass   127.0.0.1:9000;
                fastcgi_index  index.php;
                fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
                include        fastcgi_params;
            }
    
        }
    

      

  • 相关阅读:
    C# 中的委托和事件
    css样式大全(整理版)
    (转)VS2010 快捷键
    委托小例子
    .NET中Cache的使用
    ObjectiveC面向对象编程继承
    ObjectiveC简介
    ObjectiveC面向对象编程实例化对象、构造函数
    MSSql的多表关联的update语句
    ObjectC 与 Java 区别
  • 原文地址:https://www.cnblogs.com/xj76149095/p/8944413.html
Copyright © 2020-2023  润新知