Passionate generalist conquering the web one project at a time. Whether authoring libraries for node, JS, PHP, or Rust, I am always on the lookout for better solutions to common problems.
Location
USA
Work
Lead Developer & Co-founder at corpscrypt, CTO at REtech
Servers are responding to external requests. The ports you want to focus on are 80 (http) and 443 (https). NodeJS servers (like express) usually use ports beyond 1024 due to permissions, most commonly 3000 or 8080.
Now, in production, you will need to serve over http(s) for a browser to reach your app. While you have multiple options to achieve that, using Apache or Nginx is a good option as you probably also want to serve static files and assets.
Servers are responding to external requests. The ports you want to focus on are 80 (http) and 443 (https). NodeJS servers (like express) usually use ports beyond 1024 due to permissions, most commonly 3000 or 8080.
Now, in production, you will need to serve over http(s) for a browser to reach your app. While you have multiple options to achieve that, using Apache or Nginx is a good option as you probably also want to serve static files and assets.
I will make the following assumptions:
Your Nginx config could then look like this:
NOTE: be aware that you will need to look into an ssl certificate as well to serve over 443. "certbot" is what you want to google for!
Thanks for your answer, I will save this config :D