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;
}

 

相关文章:

  • 2021-07-01
  • 2022-12-23
  • 2022-12-23
  • 2021-04-09
  • 2021-06-22
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-01-28
  • 2021-10-11
  • 2021-10-10
  • 2021-06-18
  • 2022-12-23
相关资源
相似解决方案