目录位置:
/usr/local/www/nginx/conf(仅供参考)
server {
listen 443 ssl;
server_name localhost;
ssl_certificate server.crt; # cert.pem;
ssl_certificate_key server.key; # cert.key;
ssl_session_cache shared:SSL:1m;
ssl_session_timeout 5m;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
location / {
root /home/share;
autoindex on;
index index.html index.htm;
}
}
以上是公司服务器
检测配置文件没问题后重新读取 Nginx 即可
nginx -t && nginx -s reload
1 listen 443; 监听443端口
2 ssl on; 开启SSL模块
3 ssl_protocols SSLv2 SSLv3 TLSv1; 指定SSL使用协议
4 ssl_ciphers HIGH:!aNULL:!MD5; 指定加密方式
5 ssl_prefer_server_ciphers on; 配置依赖SSLv3和TLSv1协议的服务器密码将优先于客户端密码
6 ssl_session_timeout 10m; 设置会话超时时间
7 ssl_certificate xxx.cer; 配置证书
8 ssl_certificate_key xxx.key; 配置密钥