SSL配置

qcloud SSL

SSL配置文档

查看
不同SSL服务商配置的方式有所不同,下面是一个demoMr. LaBa
腾讯云SSL证书管理
cd /usr/local/nginx/conf/vhost/
vi XXX.conf
:wq OR :!q
#####nginx安装的不同 对应配置位置有所不同
server {
listen 443;
server_name www.XXXX.com XXXX.com;
ssl on;
ssl_certificate /usr/local/nginx/conf/vhost/1_www.XXXX.com_cert.crt;
ssl_certificate_key /usr/local/nginx/conf/vhost/2_www.XXXX.com.key;
ssl_session_timeout 5m;
ssl_protocols TLSv1;
ssl_ciphers  HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers   on;
access_log off;
index index.html index.htm index.php;
include /usr/local/nginx/conf/rewrite/wordpress.conf;
root /data/wwwroot/XXXX.com;
if ($host != www.XXXX.com){
    rewrite ^/(.*)$ $scheme://www.XXXX.com/$1 permanent;
    }

location ~ [^/].php(/|$){
    #fastcgi_pass remote_php_ip:9000;
    fastcgi_pass unix:/dev/shm/php-cgi.sock;
    fastcgi_index index.php;
    include fastcgi.conf;
    }
location ~ .*.(gif|jpg|jpeg|png|bmp|swf|flv|ico){
    expires 30d;
    access_log off;
    }
location ~ .*.(js|css){
    expires 7d;
    access_log off;
    }
}
server {
listen 80;
server_name XXXX.com www.XXXX.com;
rewrite ^/(.*) https://www.XXXX.com/$1 permanent;
}
service nginx restart

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注

*