Question

Nodejs and nginx - instances /subdomains limit

Hello , i am very pleased with the digital ocean service in general and i played around with many one klick nodejs and nginx setups in the past weeks.

I am just struggeling a bit with nginx proxy configuration but i am sure i will get used to it in the near future.

My question is about is there a limit with nodejs services and nginx on one dropplet or is there a recommendation or best practice of how many instances i could use and is it appropriate to use different dropplets for an API endpoint and the frontend ?

for example: application 1 domain.com application2 subdomain1.domain.com application3 subdomain2.domain.com application4 subdomain3.domain.com application5 subdomain4.domain.com

Is domain validation an alternative to a “real” certificates, because +wildcard certificates are really expensive

Thanks a lot


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Nginx itself shouldn’t have any limitations on the number of Node apps you proxy through it. For each app, you’ll just need an Nginx server block similar to this:

server {
    listen 80;

    server_name subdomain1.domain.com;

    location / {
        proxy_pass http://localhost:{YOUR_PORT};
        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;
    }
}

The main concern would be the general load on the server and the fact that by putting them all on one host, one app could potentially bring the rest down. Generally, there are a number of benefits to breaking separate services out onto separate hosts. Being able to scale up a single service on demand can be useful. One exception to that is that Node is a single-threaded process. So unless you are spawning some kind of worker processes, running a single node app on a multi-core server will lead to underused resources.

This comment has been deleted