Unable to run nodejs app on port 80

Hi guys,

I am trying to run a next js application on port 80 but it is not giving me permission even after turning off nginx to free the port. Please help!

You can’t run nodejs on port 80.

Run it on port 3000 and use a nginx proxy template that forwards traffic to that port.

1 Like

Hello Eris, thank you for your quick response. But could you please post a link or something on how to use nginx proxy template please?

https://docs.hestiacp.com/admin_docs/web.html#how-do-web-templates-work

2 Likes

Thank you guys! cheers!

1 Like

I was able to handle this requirement by:

  1. creating a regular web directory from the hestia panel
  2. nano /home/{user}/conf/web/{domain_name}/nginx.conf
  3. replace this block: “location / { … }” with this:
        location / {
            proxy_pass http://localhost:3000;
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection 'upgrade';
            proxy_set_header Host $host;
            proxy_cache_bypass $http_upgrade;
        }

even though the config says do not change this file, this is the only thing I tried that worked.

You should use a template:

Instead updating the config file but it the idea is the same…