百度教程,打开了nginx配置文件,但是找不到https Server,本人小白,在线等大神解答
回复内容:
百度教程,打开了nginx配置文件,但是找不到https Server,本人小白,在线等大神解答
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | # HTTPS server
server {
listen 443 ssl;
server_name 你的域名;
location 项目路径/ {
root html;
index index.php index.html index.htm;
}
ssl on;
ssl_certificate 证书路径/ssl-unified.crt;
ssl_certificate_key 私匙路径/de_ssl.key;
ssl_session_cache shared:SSL:20m;
ssl_session_timeout 60m;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
}
|
ログイン後にコピー
然后再将http请求转到https
1 2 3 4 5 | server {
listen 80;
server_name 你的域名;
rewrite ^/(.*)$ https:
}
|
ログイン後にコピー