
非标准端口进行http重定向https
我们可以通过捕获Http请求497错误页面,来实现https的跳转
server {
listen 8089ssl; # 监听非标准HTTPS 端口
server_name example.com;
ssl_certificate /path/to/cert.pem;
ssl_certificate_key /path/to/key.pem;
# 捕获 497 错误并重定向到 HTTPS
error_page 497 https://$host$request_uri;
location / {
root /var/www/html;
}
}
评论
隐私政策
你无需删除空行,直接评论以获取最佳展示效果