nginx配置ssl(配置文件)

nginx配置ssl(配置文件),只列出部分内容。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# http server
server {
listen 80;
server_name www.zenwu.site zenwu.site;

# 将Http请求转化成Https请求
return 301 https://$server_name$request_uri;
}

# HTTPS server
server {
listen 443 ssl;
server_name www.zenwu.site zenwu.site;
ssl_certificate /home/ssl/www.zenwu.site_chain.crt; # 证书
ssl_certificate_key /home/ssl/www.zenwu.site_key.key; # 证书
ssl_session_cache shared:SSL:1m;
ssl_session_timeout 5m;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
location / {
root /home/www/zenwuhexo/;
index index.html index.htm;
}
}
--------------本文结束 感谢您的阅读--------------