server {
listen 80;
server_name www.locusy.top;
root /www/temp/blog/public/client;
index index.html;
location ~ .*\.(jpg|jpeg|gif|png|ico|css|js|pdf|txt)$ {
root /www/temp/blog/public;
}
rewrite ^(.*)$ https://$host$1 permanent; #设置http跳转https
# return 301 https://www.locusy.top$request_uri;
}
server {
listen 443;
server_name www.locusy.top;
ssl on;
ssl_certificate cert/1652724_www.locusy.top.pem;
ssl_certificate_key cert/1652724_www.locusy.top.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;
#配置静态网站地址
root /www/temp/blog/public/client;
index index.html;
location ~ .*\.(jpg|jpeg|gif|png|ico|css|js|pdf|txt)$ {
root /www/temp/blog/public;
}
}
更多内容请访问:IT源点
注意:本文归作者所有,未经作者允许,不得转载