第一:实验故障
今天小编在搭建完nginx反向代理两个tomcat站点,实现负载均衡的实验,访问网页内容时,提示如下报错:
http status 400 – 错误的请求type 异常报告
消息 the character [_] is never valid in a domain name.
描述 the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).
第二:故障原因
根据浏览器报错的提示消息,意思为:在一个域名中使用字符“_”是不正确的;
原来问题出在了nginx主配置文件中给后端tomcat服务器池起的名字上,不支持下划线
第三:解决方法
将下划线改成“-”
,再重新启动nginx服务就没问题了。
补充知识:
нттр状态码
- 当使用浏览器访问某一个url,会根据处理情况返回相应的处理状态
- 通常正常的状态码为2xx, 3xx (如200)
- 如果出现异常会返回4xx, 5xx (如404)
4xx是客户端错误,5xx是服务器错误
到此这篇关于nginx http status 400 – 错误的请求问题解决的文章就介绍到这了,更多相关nginx http status 400 错误内容请搜索代码网以前的文章或继续浏览下面的相关文章希望大家以后多多支持代码网!
发表评论