配置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.

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章