• nginx 配置https


    #配置1http跳转https配置
    server {
        listen    80;
        server_name  xxx.com;#域名
        rewrite ^(.*)$ https://$host$1 permanent; 
    }
    
    #配置2https 443端口
    server {
        #listen   80;#去掉#号开启同时监听HTTP和HTTPS,根据访问协议自动调整(去掉配置1)
        listen       443 ssl;
        server_name  xxx.com;#域名
        root         /project;#项目目录
        #注意这里没有 ssl on
        ssl_certificate /xxx.pem;  # 指定证书的位置,绝对路径
        ssl_certificate_key /xxx.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;
    
        location / {
            index index.html index.htm index.php;
            try_files $uri $uri/ /index.php?$args;
        }
    
        location ~ .php {
            root /project;
            fastcgi_pass 127.0.0.1:9000;
            fastcgi_index index.php;
            include fastcgi.conf;
            #fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            #include fastcgi_params;
            #set $path_info "";
            #set $real_script_name $fastcgi_script_name;
            #if ($fastcgi_script_name ~ "^(.+?.php)(/.+)$") {
            #    set $real_script_name $1;
            #    set $path_info $2;
            #}
            #fastcgi_param SCRIPT_FILENAME $document_root$real_script_name;
            #fastcgi_param SCRIPT_NAME $real_script_name;
            #fastcgi_param PATH_INFO $path_info;
        }
    }
    
  • 相关阅读:
    oracle递归层级查询 start with connect by prior
    C 常量指针和指针常量
    C 字符串常量和字符串变量定义和区别
    C 指针改变变量值
    UITableViewCell的高度与UILabel自适应
    手动开启ARC
    SWIFT模糊效果
    SWIFT中使用AFNetwroking访问网络数据
    MAC机中安装RUBY环境
    CocoaPods安装和使用教程
  • 原文地址:https://www.cnblogs.com/suli0827/p/14392748.html
Copyright © 2020-2023  润新知