Skip to content

Commit

Permalink
feat(nginx): 支持nginx部署
Browse files Browse the repository at this point in the history
  • Loading branch information
dongyuanxin committed Oct 2, 2020
1 parent 619b106 commit 96d22bc
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
server {
listen 80;
server_name xin-tan.com;
# nginx最新写法
return 301 https://$server_name$request_uri;

location / {
root /home/ubuntu/data/blog-static;
index index.html index.htm index.nginx-debian.html;
try_files $uri $uri/ =404;
}
}

server {
listen 443 ssl;
#填写绑定证书的域名
server_name xin-tan.com;
#证书文件名称
ssl_certificate /home/ubuntu/data/blog-https/1_xin-tan.com_bundle.crt;
#私钥文件名称
ssl_certificate_key /home/ubuntu/data/blog-https/2_xin-tan.com.key;
ssl_session_timeout 5m;
#请按照以下协议配置
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
#请按照以下套件配置,配置加密套件,写法遵循 openssl 标准。
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;
ssl_prefer_server_ciphers on;

location / {
#网站主页路径。此路径仅供参考,具体请您按照实际目录操作。
root /home/ubuntu/data/blog-static;
index index.html index.htm index.nginx-debian.html;
try_files $uri $uri/ =404;
}
}

0 comments on commit 96d22bc

Please sign in to comment.