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

Nginx配置ssl安全证书

时间:2017-09-22 13:07:34      阅读:154      评论:0      收藏:0      [点我收藏+]

标签:cipher   div   cgi   log   ica   htm   lis   nginx配置   http   

server {
        listen       443;
        server_name  www.loaclhost.com;
        ssl  on;
        root   /web;
        ssl_certificate      /data/ssl/xxx.crt;
        ssl_certificate_key  /data/ssl/xxx.key;
        ssl_session_cache    shared:SSL:1m;
        ssl_session_timeout  5m;
        ssl_protocols  TLSv1 TLSv1.1 TLSv1.2;
        ssl_ciphers  HIGH:!RC4:!MD5:!aNULL:!eNULL:!NULL:!DH:!EDH:!EXP:+MEDIUM;
        ssl_prefer_server_ciphers  on;

        location / {
            index  index.html index.htm index.php;
        }
        location ~ .*\.(php|php5)?$ {
             fastcgi_pass  127.0.0.1:9000;
             fastcgi_index index.php;
             include fastcgi.conf;
             fastcgi_param HTTPS $https if_not_empty;
       }
        access_log  logs/ssl_access.log  main;
        error_log  logs/ssl_error.log  notice;
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
    }

配置如上所示,可以设置rewrite规则强制跳转https

Nginx配置ssl安全证书

标签:cipher   div   cgi   log   ica   htm   lis   nginx配置   http   

原文地址:http://www.cnblogs.com/minseo/p/7574150.html

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