banner
May 9, 2022
135 Views

Lỗi tomcat The character [_] is never valid in a domain name.

Written by
banner

Chỉnh nginx proxypass sang tomcat thì gặp lỗi sau

HTTP Status 400 – Bad Request
Type Exception Report

Message The character [_] is never valid in a domain name.

Description 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).

Exception

java.lang.IllegalArgumentException: The character [_] is never valid in a domain name.
	org.apache.tomcat.util.http.parser.HttpParser$DomainParseState.next(HttpParser.java:974)
	org.apache.tomcat.util.http.parser.HttpParser.readHostDomainName(HttpParser.java:870)
	org.apache.tomcat.util.http.parser.Host.parse(Host.java:71)
	org.apache.tomcat.util.http.parser.Host.parse(Host.java:45)
	org.apache.coyote.AbstractProcessor.parseHost(AbstractProcessor.java:294)
	org.apache.coyote.http11.Http11Processor.prepareRequest(Http11Processor.java:772)
	org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:351)
	org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
	org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)
	org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1639)
	org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
	java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	java.base/java.lang.Thread.run(Thread.java:829)
Note The full stack trace of the root cause is available in the server logs.

Apache Tomcat/9.0.31 (Ubuntu)

Lỗi do setting proxypass có dấu _ ở tên upstream. Xóa đi là được.

Article Categories:
config
banner

Leave a Reply

Your email address will not be published. Required fields are marked *