最近的更新中,官方增加了「一键申请 SSL 证书验证目录相关设置」,使得启用反向代理后能够自动续签
- location ~ \.well-known{
- allow all;
- }
复制代码
但是「SSL」里面的「强制 HTTPS」还是有问题,直接判断访问端口是不是 443,不是 443 就强制跳转,这样的规则会导致自动续签功能失效,希望改进一下
- set $http_to_https '0';
- if ($server_port !~ 443){
- set $http_to_https '${http_to_https}1';
- }
- if ($uri !~ \.well-known){
- set $http_to_https '${http_to_https}1';
- }
- if ($http_to_https = '011') {
- rewrite ^(/.*)$ https://$host$1 permanent;
- }
复制代码
还有就是 nginx 如果能在安装的时候自定义编译模块就更加方便了 |
|