Loading... 对于家宽公网 ip 来说,没有标准的 80, 443 端口,为了安全考虑对外使用一个 nginx 作为出口,并配置 https 协议使用一个端口,不配置 http,这时直接访问 https://example.com:port 会提示:`400 The plain HTTP request was sent to HTTPS port`。 可我不想让用户看到这个提示来知道可以切换为 https 访问,解决办法为在 nginx 的 `server` 代码块中配置: ``` error_page 497 =444 @close; location @close { return 444; } ``` 最后修改:2025 年 05 月 08 日 © 允许规范转载 打赏 赞赏作者 支付宝微信 赞 如果觉得我的文章对你有用,请我喝杯咖啡吧。