433端口部分的配置为ssl证书配置。
其中,ssl_certificate与ssl_certificate_key字段对应证书所在目录与证书名
其他配置字段参考官网
server/location中以下内容控制http强制转为https
rewrite ^(.*)$ https://$host$1 permanent
server/location中以下内容history路由处理,即,让http://finglodon.com/bx可通过浏览器输入直接访问
注意,http://会跳转到https://,所以也要处理https://finglodon.com/bx的history路由问题,故,433端口的server中也配置这一项
try_files $uri /index.html
rewrite “/” https://finglodon.com/bx permanent
nginx默认没有目录浏览权限,需要开启浏览目录权限的话增加autoinedx on,默认是off。我们这里不需要,不加。
原文:https://www.cnblogs.com/zs-note/p/11981312.html