-
Notifications
You must be signed in to change notification settings - Fork 186
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
619b106
commit 96d22bc
Showing
1 changed file
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |