I have a Vagrant box with JBoss. I'm trying to forward two ports. My Vagrantfile
has the following for that
web.vm.network "forwarded_port", guest: 8080, host: 8080 # jboss
web.vm.network "forwarded_port", guest: 9990, host: 9990 # jboss management console
On vagrant up web
I can see in console
==> web: Forwarding ports...
web: 8080 => 8080 (adapter 1)
web: 9990 => 9990 (adapter 1)
When I do netstat
ports seem to be ok
$ sudo netstat -tulpn | grep VirtualBox
[sudo] password for ostraaten:
tcp 0 0 0.0.0.0:9990 0.0.0.0:* LISTEN 21241/VirtualBox
tcp 0 0 127.0.0.1:2222 0.0.0.0:* LISTEN 21241/VirtualBox
tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN 21241/VirtualBox
When I do curl -v http://localhost:8080
on the Vagrant box itself, this works fine. I see the JBoss stuff.
When I do curl -v https://localhost:8080
on the host other stuff happens.
$ curl -v http://localhost:8080
* Rebuilt URL to: http://localhost:8080/
* Hostname was NOT found in DNS cache
* Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 8080 (#0)
> GET / HTTP/1.1
> User-Agent: curl/7.35.0
> Host: localhost:8080
> Accept: */*
>
* Recv failure: Connection reset by peer
* Closing connection 0
curl: (56) Recv failure: Connection reset by peer
There is no firewall running on the Vagrant box.
Configuration for forwarding ports at first seems trivial but it now looks like there is more to it. How should this work?