nginx配置https
作者:
还是做个大叔好啊 | 来源:发表于
2017-06-28 17:46 被阅读0次server {
listen 80;
listen 443 ssl;
ssl on;
server_name www.hcnbjf.com hcnbjf.com;
ssl_protocols TLSv1.2 TLSv1.1 TLSv1;
ssl_certificate /etc/ssl/hcnbjf.crt; #证书位置
ssl_certificate_key /etc/ssl/hcnbjf.key; #key位置
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
if ($server_port = 80) {
rewrite ^(.*)$ https://$host$1 permanent;
}
index index.html index.htm index.php;
root /home/www/jf;
if ( $host ~* ^(?!www\.) ) {
rewrite .* $scheme://www.$host$request_uri permanent;
}
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?s=$1 last;
break;
}
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
include fastcgi_params;
fastcgi_pass unix:/var/run/php-fpm.socket;
}
}
本文标题:nginx配置https
本文链接:https://www.haomeiwen.com/subject/cioucxtx.html
网友评论