JBoss | HTTP/1.1 400 No Host matches server name localhost

I’m running an app inside a docker container and the host in server.xml of the JBoss-4.2 server is “localhost”.
This command

curl -v localhost:8090/ 

establishes a connection but return “HTTP/1.1 400 No Host matches server name localhost”
and

cat /etc/hosts 

gives

127.0.0.1 localhost
::1 localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
172.17.0.2 5f6b9e76d025
127.0.0.1 endpoint.used.bytheapp

Any suggestions ?

Source: StackOverflow