Making node-host not just listen to localhost

27 views
Skip to first unread message

Tucker Osman

unread,
Aug 26, 2014, 9:44:20 PM8/26/14
to jsap...@googlegroups.com
Hello,

First off, I love node-host/jsapp.us. I think it's a marvelous idea. So much so that I wanted to run my own version for myself.

I cloned the git repository, made it, made the nginx.conf file correctly (I think, I can't really test it) and ran both master.js and nginx. I'm running Ubuntu Server 12.04.5 LTS, so I can't use a browser to test from the terminal, but when I nc localhost 8080, type "GET /" and press enter a few times, it spews out the frontend. Perfect.

This is where it gets interesting. I'm running this in a VM behind VirtualBox's NAT. The host machine has IP A, and the guest that's running node-host has IP B. I have A:8080 forwarded to B:80. When I request that from a web browser (A:8080), it says "Bad Gateway". I strongly suspect that's because node-host isn't listening for anything except the loopback interface. How can I get this to work? Is it a node-host only listening to the loopback interface for requests or is there something wrong with my nginx config?

Thank you for any help you can provide. I like this a lot and would like to make it work.

Tucker

Matthew Francis-Landau

unread,
Aug 26, 2014, 11:22:17 PM8/26/14
to jsap...@googlegroups.com
It sounds like you might have nginx misconfigured, as you should have 80 forward to 8080.  Also, you would usually get a bad gateway response when the upstream service isn't running.  You are going to need to keep the master application running so that it can serve requests.

If you are using something similar to the example nginx config ( https://github.com/matthewfl/node-host/blob/master/devel/nginx.conf#L73 ), then you might have to set the hostname to access the front end, eg: `curl -H 'Host: dev.matthewfl.com' http://localhost:80/`
Reply all
Reply to author
Forward
0 new messages