Nginx配置Tomcat8反向代理出现 java.lang.IllegalArgumentException: The character [_] is never valid in a domain name.

时间:2021-09-29 17:49:33

在配置Nginx的反向代理,访问反向代理的路径而出现了异常

java.lang.IllegalArgumentException: The character [_] is never valid in a domain name.

Nginx配置Tomcat8反向代理出现 java.lang.IllegalArgumentException: The character [_] is never valid in a domain name.


原因是在nginx配置文件中配置upstream时用了“_”字符!!

Nginx配置Tomcat8反向代理出现 java.lang.IllegalArgumentException: The character [_] is never valid in a domain name.

 我们只需要把  ”_”去掉即可解决问题!  

ps:

在Tomcat7中可以,Tomcat8却不可以...注意下吧!