当前位置:首页 > 服务器技术 > nginx

nginx 配置 ssl 及强制跳转

 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;
        }

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


【说明】本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:254677821)!