nginx 报错 The plain HTTP request was sent to HTTPS port
https://hostname:4441
nginx监听4441端口使用https协议,浏览器输入http://hostname:4441报错
The plain HTTP request was sent to HTTPS port
原因是如果用户在使用 http 访问时,就会报497错误,
用error_page 处理一下即可:
server { listen 4441 ssl; ... ... error_page 497 https://$host:4441; }