Nginx 配置SSL安全证书示例

server {
    listen 80;
    server_name   crm.baichengjiankang.cn;
    access_log off;
    rewrite ^/(.*) https://crm.baichengjiankang.cn/$1 permanent;
 }

server {
    listen 443 ssl;
    server_name   www.88888.cn;
    access_log  logs/www.88888.cn.log main;

    ssl_certificate /application/nginx/conf/ssl/www.88888.cn.pem;
    ssl_certificate_key /application/nginx/conf/ssl/www.88888.cn.key;
    ssl_session_timeout 5m;
    ssl_protocols SSLv2 SSLv3 TLSv1 TLSv1.1 TLSv1.2;
    ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
    ssl_prefer_server_ciphers on;

    index index.php index.html index.htm default.php default.htm default.html;
    root /data/wwwroot/testweb;

    location / {
        #try_files $uri $uri/ /admin.php$is_args$args;
        include /data/wwwroot/testweb/nginx.htaccess;
        autoindex  off;
    }

    location ~ \.php$ {
        root /data/wwwroot/testweb;
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_index  index.php;
        include        fastcgi.conf;
    }
}

 

posted @ 2025-07-16 11:42  流浪2024  阅读(9)  评论(0)    收藏  举报