Skip to content
Back to services

Projects and reverse proxy

Many projects and domains on one server

A server has a single public IP, but it can serve many domains and projects. The key is the reverse proxy: nginx receives every request and hands each one to its project. SERVILINUX sets it up for you.

Swipe the diagram to see all of it

Your server16 GB RAM · 4 vCPU◎api.tienda.com◎admin.tienda.com◎app.cliente.com◎www.cliente.com⌖203.0.113.10public IP :443⇄nginxreverse proxy🔒Let's EncryptHTTPS per domain⬢AdonisJS · API127.0.0.1:3001⬢AdonisJS · admin127.0.0.1:3002⬢Node.js · app127.0.0.1:3003▤Website (PHP)/srv/apps/wwwServer memoryAdonisJS ×2 · 1 GBNode.js · 0,5 GBnginx + PHP · 0,3 GBDatabase · 2,2 GBFree · 12 GBAdonisJS ×2 1 GBNode.js 0,5 GBnginx + PHP 0,3 GBDatabase 2,2 GBFree 12 GB
  • api.tienda.com → AdonisJS
  • admin.tienda.com → AdonisJS
  • app.cliente.com → Node.js
  • www.cliente.com → PHP site

Each color follows a domain: it reaches the public IP, nginx recognizes it by name, adds HTTPS and hands it to its project. Apps listen on local ports that cannot be seen from the internet; the website is served directly by nginx. Below, how much memory each part uses (rough figures).

Many domains, one IP

All domains point to the same public IP. nginx reads the name on each request and sends it to the right project; a project can also have several domains.

Each app on its own port, not exposed

Node.js and AdonisJS apps listen only on 127.0.0.1, each on its own port. From the internet only 80 and 443 are open, and everything goes through nginx.

Free HTTPS for every domain

nginx holds each domain’s Let’s Encrypt certificate and renews it automatically. Before requesting it, SERVILINUX checks that the domain really reaches your server, even through a proxy.

Each project isolated and recoverable

Each project has its own system user, its service with automatic restart and saved versions: if a deployment fails, it rolls back to the previous version on its own.

How many projects fit on a server?

It depends mostly on memory and traffic. As a guide:

MemoryStatic and light PHP sitesNode.js / AdonisJS apps
1 GB5 to 101 or 2, without a local database
2 GB10 to 203 or 4, with a small database
4 GB20 or more6 to 8, with a database
16 GBDozens20 or more, with large databases

Rough figures for moderate traffic. A busy project may need a server of its own; Sentinel shows the real memory each server uses.

In SERVILINUX

How it is done

  1. 1
    Point your domains

    An A record to the server IP, or use the free temporary domain.

  2. 2
    Create the projects

    Static, PHP, Node.js or AdonisJS: each gets its own port and user.

  3. 3
    Deploy from git

    Manually or automatically on each push, with rollback if something fails.

  4. 4
    Turn on HTTPS

    One click per domain; nginx is set up as the reverse proxy.