I have a little issue when I try to use nodejs as a web server on vagrant (on OS X).
My config file is linked below, I have only nodejs and mongodb installed.
The box IP is 10.10.56.101
(I needed another ip than 192.168.56.101
to work at my school).
I try to reach the nodejs server with the little script linked below. The script only listen on port 51160
and answer OK.
First I didn't get any answers and after searching I found that I needed to do a port forwarding and with a iptable it worked (the command linked below, on port 51160
instead of 8000
).
I reinstalled the vagrant machine with the same configuration and I wasn't able to get the machine to work anymore.
I can curl localhost:51160
from inside the vagrant machine but I can't get anything from outside the VM.
Files :
- config.yaml : https://gist.github.com/nobe4/0bb16fdb23279d416656
- server.js : https://gist.github.com/nobe4/639d63ef612f247d9309
- iptable command : https://gist.github.com/kentbrew/776580#file-node-on-ec2-port-80-txt-L39