奇妙伞 Good Luck To You!

nginx https配置文件

server {

listen 80;

server_name www.qm3.com.cn;

rewrite ^(.*) https://$server_name$1 permanent;

}

server {

         listen        443;

         server_name   www.qm3.com.cn;

         root          /usr/local/nginx/www.qm3.com.cn;

         index        index.php index.html.index.jsp;

         ssl on;

         ssl_certificate /usr/local/nginx/cert/www.qm3.com.cn.pem;

         ssl_certificate_key /usr/local/nginx/cert/www.qm3.com.cn.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.php;

            if (!-e $request_filename) {

            rewrite  ^/(.*)$  /index.php/$1  last;

            break;

            }

            client_max_body_size    20m;

        }

        error_page  403 404              /404.html;

        error_page  500 502 503 504  /50x.html;

        location ~ \.php {

            fastcgi_pass   127.0.0.1:9000;

            #fastcgi_pass  unix:/tmp/php-cgi.sock;

            fastcgi_index  index.php;

            include        fastcgi.conf;

            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;

        }

        location ~ \.(gif|jpg|jpeg|png|bmp|swf|js|css)$ {

            access_log   /dev/null;

            error_log    /dev/null;

            expires      30d;

        }

}



除特别注明外,本站所有文章均为奇妙伞原创,转载请注明出处来自https://www.qm3.com.cn/post/178.html

标签: nginxhttps配置

作者:David 分类:Web服务相关 浏览:2550 评论:0
留言列表
发表评论
来宾的头像