Search code examples
ubuntunginxports

Is correct to open multiple ports in Ubuntu and Nginx?


About this issue: Nginx Gunicorn one ip multiple django sites in folders

I've already solve my problem opening multiple ports in my Ubuntu server based in this post https://serverfault.com/questions/655067/is-it-possible-to-make-nginx-listen-to-different-ports, but I still have a few questions about that:

  1. Is it correct to open multiple ports to serve multiple instances for the same app?

  2. If that is correct, how can I hide the port in the url for the users? To access one instance, they (the user) must type "http://1.1.1.1:81/app1/" or "http://1.1.1.1:82/app2/". Is this a good idea?

Thanks!


Solution

    1. Yes, you could do that. I would also say you should utilize multiple subdomains as seen in the above answer.
    2. That is not bad, as you only define a specific port. I have also done it and it works just as normal.