nginx: 400 Bad Request | The plain HTTP request was sent to HTTPS port
nginx版本1.0.4
nginx一般情況下配置;
server { listen 443; server_name localhost; ssl on; root html; index index.html index.htm; ssl_certificate cert/214525134250577.pem; ssl_certificate_key cert/214525134250577.key; ssl_session_timeout 5m; ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_prefer_server_ciphers on; location / { root html; index index.html index.htm; } }
然後神器的一幕發生了,首先是: nginx: [warn] invalid value "TLSv1.1" nginx: [warn] invalid value "TLSv1.2"
把 TLSv1.1 TLSv1.2 刪掉;報錯 nginx: 400 Bad Request | The plain HTTP request was sent to HTTPS port
參考官方文件解決如下:
server {
listen 80;
server_name localhost;
root html;
index index.html index.htm;
listen 443 ssl; #注意這裡
#ssl on;
ssl_certificate cert/214525134250577.pem;
ssl_certificate_key cert/214525134250577.key;
ssl_session_timeout 5m;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
ssl_protocols TLSv1;
ssl_prefer_server_ciphers on;
location / {
root html;
index index.html index.htm;
}
}
刪掉 ssl on; 並在 listen 443; 後面加上ssl即可
相關文章
- HTTP Status 400 – Bad RequestHTTP
- Error parsing HTTP request header--400 bad requestErrorHTTPHeader
- Spring Mvc Http 400 Bad Request問題排查SpringMVCHTTP
- 400 Bad Request(錯誤請求)
- nginx過一段時間出現400 Bad Request 錯誤的解決方法Nginx
- [wget] HTTP request sent, awaiting response... No data received.wgetHTTPAI
- SpringMVC 404:Bad requestSpringMVC
- Servlet&HTTP&RequestServletHTTP
- PHP Simulation HTTP Request(undone)PHPHTTP
- Jmeter之HTTP Request DefaultsJMeterHTTP
- Excel為批註設定圖片背景 出現Bad Request - Request Too longExcel
- Jmeter系列(21)- 詳解 HTTP RequestJMeterHTTP
- HTTP Headers的Request HeadersHTTPHeader
- nodejs使用request傳送http請求NodeJSHTTP
- ngx_http_discard_request_body 函式分析HTTP函式
- FND_REQUEST.SUBMIT_REQUEST和 FND_CONCURRENT.WAIT_FOR_REQUESTMITAI
- Request物件物件
- 關於FND_REQUEST.SUBMIT_REQUEST和 FND_CONCURRENT.WAIT_FOR_REQUESTMITAI
- ngx_http_request_t結構體詳解HTTP結構體
- ASP.NET MVC got 405 error on HTTP DELETE requestASP.NETMVCGoErrorHTTPdelete
- http request-01-XMLHttpRequest XHR 簡單介紹HTTPXML
- 基礎篇-http協議《http 簡介、url詳解、request》HTTP協議
- nginx 部署vue http、httpsNginxVueHTTP
- 【等待事件】global cache cr request/gc current request事件GC
- request.getRequestURI 與request.getServletPath() 區別Servlet
- Git Fork Pull Request(PR)和Merge Request(MR)Git
- ABAP 辨析ON INPUT|REQUEST|CHAIN-INPUT|CHAIN-REQUESTAI
- Django中的request.GET和request.POSTDjango
- urllib.request.Request物件封裝請求物件封裝
- 使用 request 和 cheerio 庫來傳送 HTTP 請求HTTP
- http協議學習-請求頭Request HeadersHTTP協議Header
- HTTP請求中 request payload 和 formData 區別?HTTPORM
- request爬蟲爬蟲
- request與HttpResponseHTTP
- Request: credentials property
- 06-記錄網路請求Request failed: unacceptable content-type: text/plain(AFNetworking)AI
- 關於 Angular HTTP Interceptor 中 Request 和 Response 的 immutable 特性AngularHTTP
- http協議學習系列(請求頭---Request Headers)HTTP協議Header