- 获取证书文件
- Nginx 开启SSL
server {
listen 443 default ssl;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
proxy_set_header Host $host;
ssl_certificate /usr/local/nginx/cert/server.pem;
ssl_certificate_key /usr/local/nginx/cert/ca.key;
ssl_session_cache shared:SSL:128m;
ssl_session_timeout 5m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;
ssl_prefer_server_ciphers on;
location / {
root html;
index index.html index.htm;
try_files $uri /index.html;
}
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 重启Nginx
cd ../sbin
./nginx -s reload