配置web服务器https的时候访问出现400(apache/nginx)

配置web服务器https的时候访问出现400(apache/nginx)

今天在配置web服务器的时候使用本机浏览器访问出现400的错误
APACHE
在这里插入图片描述
NGINX
在这里插入图片描述
解决方法其实很简单
访问的时候前面加个https

如下所示
https://IP:443

这样就显示正常了 其实就是自己的一点失误
但是网上各种写的乱七八糟都不是我想要的结果
在这里插入图片描述
国人并不靠谱
最后看到serverfault这段评论才发现问题所在

Your URL of http://example.com:443 is causing the browser to make a plain HTTP request to port 443. But the server is expecting TLS there which means that your plain HTTP request is unexpected. Apache is at least nice enough to check if the incoming data for a plain HTTP request in this case so that it can offer you a more useful description:

Reason: You’re speaking plain HTTP to an SSL-enabled server port. Instead use the HTTPS scheme to access this URL, please.

If you try such requests with other servers then they would either close the connection without any error at all or just hang because they are still hoping to get a TLS handshake from the client.

猜你喜欢

转载自blog.csdn.net/qq_40695642/article/details/107132665