Nginx服务
对非同源地址的nginx配置要求
http同端口访问http跳转https(497错误)
关于Nginx 的 location 匹配规则总结
Nginx+LUA+Redis实现token访问鉴权
Nginx实现后端Server域名动态解析
Nginx反向代理跨域问题
浏览器报错ERR_CONTENT_LENGTH_MISMATCH
Nginx常见HTTP Code错误排查
使用acme.sh部署证书至Nginx
Nginx在普通用户下使用特权端口 (443端口)
Nginx配置自定义状态页
try_files和alias的组合使用
Nginx中301重定向导致端口丢失
本文档使用 MrDoc 发布
-
+
home page
http同端口访问http跳转https(497错误)
![]()想设置只允许指定端口访问http服务,并且只允许该端口通过https访问 需要设置访问该端口的http请求时,需要让其自动跳转到该端口的https的协议访问 在nginx的添加如下配置即可: ```shell #In order to solve the problem that the browser returns 400 with http request ssl port #400 Bad Request: The plain HTTP request was sent to HTTPS port. error_page 497 https://$host:$server_port$request_uri; ``` 该配置放在server块下面重启nginx即可 > 注意:该端口必须为SSL端口
Nathan
July 20, 2021, 11:17 a.m.
转发文档
Collection documents
Last
Next
手机扫码
Copy link
手机扫一扫转发分享
Copy link
Markdown文件
PDF文件
Docx文件
share
link
type
password
Update password