Hi Ray. If the node.js was running on realserver.com:5000. For the Reverse Proxy I first set up a DNS alias for the server (ie. myapp.com to realserver.com.) The reverse proxy in NGINX would look something like this:
server { listen 80; server_name myapp.com; location / { proxy_pass http://localhost:5000/; } } When the user browses to myapp.com (no port #) it gets redirected to realserver.com>localhost:5000. This is 1 way to eliminate the user to enter a port #. All the best, Grant. On Saturday, June 20, 2015 at 11:36:33 PM UTC-3, Ray Jender wrote: > > But how does that alleviate the issue of haveing to browse to IP:Port? > I'm not liking that in a production environment. Or am I missing something? > > On Saturday, June 20, 2015 at 10:36:28 AM UTC-4, zladuric wrote: >> >> We set the port to whatever we want, but it's a common security and usage >> practice to not use "low ports" (lower then 1024) for app servers. In fact, >> in most operating systems, if you run the app server as a non-system user, >> you _cannot_ bind to such port. >> >> The usual practice for Node.js (or, say, Tomcat, or Websphere or RoR or >> any other app servers) to be bound to some high port (above 1024) and then >> let nginx, apache, IIS or something else serve the port 80, and proxy over >> requests to the app server. >> >> That way on one host you can even run multiple app servers with one web >> server. >> >> Nothing would stop you to run as, say, root on Linux or a Mac, and bind >> the Node.js app to port 80, but then your app has root privileges, and if >> your code (or some of the modules you use) is buggy or has security >> problems, your app would be a risk to the whole system. >> >> Zlatko >> >> On Saturday, June 20, 2015 at 3:43:51 AM UTC+2, Ray Jender wrote: >>> >>> >>> So, for all of the example and demo code I have seen, they always >>> include doing "node file.js" and then it echos back "Listening at: >>> http://localhost:8080" or similar. >>> Which implies I have to browse to port 8080 to use the app. >>> >>> My question is how does this work in production? I have never had to >>> browse to a website using a port number? I'm confused? >>> How can I simply browse to a URL and not include a port number? >>> >>> Thanks, >>> >>> Ray >>> >>> >>> -- Job board: http://jobs.nodejs.org/ New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines --- You received this message because you are subscribed to the Google Groups "nodejs" group. To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+unsubscr...@googlegroups.com. To post to this group, send email to nodejs@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/86cd3a7e-75ac-43de-82f0-09ec0350d192%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.