server
{
listen 80;
server_name zuzv.com;
server_name www.zuzv.com;
rewrite ^(.*)$ https://$host$1 permanent;
}
server
{
listen 443 ;
ssl on;
server_name zuzv.com;
server_name www.zuzv.com;
index index.html index.htm index.php;
root /var/www/zuzv/;
ssl_certificate ./cert/7290604.zuzv.com.pem;
ssl_certificate_key ./cert/7290604_.zuzv.com.key;
ssl_session_timeout 5m;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
#error_page 404 /404.html;
include enable-php.conf;
location / {
if (!-e $request_filename){
rewrite ^/index.php(.*)$ /index.php?s=$1 last;
rewrite ^(.*)$ /index.php?s=$1 last;
break;
}
}
location /nginx_status
{
stub_status on;
access_log off;
}
location ~ .*\.(js|css)?$
{
expires 12h;
}
location ~ /\.
{
allow all;
}
}
nginx 配置https 并且http强制跳转https
最新推荐文章于 2024-07-25 14:47:51 发布