码迷,mamicode.com
首页 > 其他好文 > 详细

nginx 配置 ssl 及强制跳转

时间:2018-02-25 19:03:22      阅读:167      评论:0      收藏:0      [点我收藏+]

标签:ast   com   跳转   nginx   img   配置   www   ssi   www.   

 server {
    listen       80;
    server_name  技术分享图片www.xxx.com;
    rewrite ^(.*) 技术分享图片https://$server_name$1 permanent;
}
server {
        listen 443 ssl;
        server_name 技术分享图片www.xxx.com;
ssl_certificate      /etc/nginx/ssl_key/技术分享图片xxx.com.pem;
ssl_certificate_key  /etc/nginx/ssl_key/技术分享图片xxx.com.key;
ssl_session_cache    shared:SSL:1m;
ssl_session_timeout  5m;
ssl_ciphers  HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers  on;
        index index.html index.php index.htm;
        root /usr/share/nginx/html/nfsroot/m;
        error_page  404              /404.html;
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
                root   /usr/share/nginx/html;
        }
        location ~ \.php$ {
                root           /usr/share/nginx/html/nfsroot/m;
                fastcgi_pass   127.0.0.1:9000;
                fastcgi_index  index.php;
                fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
                include        fastcgi_params;
        }

nginx 配置 ssl 及强制跳转

标签:ast   com   跳转   nginx   img   配置   www   ssi   www.   

原文地址:https://www.cnblogs.com/cbywan/p/8469703.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!