Artica Wiki

Reverse-Proxy in cluster mode

Run several Artica reverse-proxies behind a load balancer with one shared configuration, managed on a master and copied by replicas over mutual TLS.

Back to the Reverse-Proxy section

One reverse-proxy is a single point of failure.
With the reverse-proxy cluster, you build and secure your sites once, on one Artica server.
Every other reverse-proxy of the cluster copies that configuration within seconds.

Put them behind your load balancer: visitors get the same sites, certificates and WAF rules whatever node answers.

You no longer copy settings from one server to another or keep sync scripts.
If a node ends up with a different configuration, the cluster notices it and puts the master version back.

The master: follower servers, shared configuration and identity check

Benefits

Use cases

How it works

reverseclusterartica.png

  1. You change a site on the master.
  2. The master builds its own configuration.
    It publishes a new version only when its own build succeeded.
  3. Each replica asks the master for the latest version every 10 seconds.
  4. When a new version exists, the replica downloads it, checks it, and applies it all or nothing.
  5. The replica reports the result to the master.
    The master shows it in the node list.

A version is a time stamp, for instance 20261127-014925.
The same version on the master and on a replica means the same configuration.

What travels and what stays on each node

Replicated to every node Kept on each node
Websites and all their settings Statistics and logs
Backends and load-balancing PostgreSQL data (WAF reports, events)
SSL certificates used by the sites Dynamic bans
WAF rules and the global reverse-proxy settings Disk caches
JavaScript challenge key, OIDC session keys Network cards and node identity

A few things cannot work across nodes:

Requirements

Step 1: Make a server the master

On the server that holds your sites, open Web Services > Cluster.
A server that is not in a cluster shows two choices.

A server that is not in a cluster

In Make this server the master:

Click Enable the cluster.
The configuration of this server becomes the reference.

You can change these values later with the Parameters button of the master page.

Parameters of the master

Changing the cluster port of a master makes its replicas lose contact.
They must join the master again.

Step 2: Add a node on the master

On the master page, click Add a node.

Add a node: one-time token and master fingerprint

The window shows two values:

Copy both.
The token works only once.
Closing the window and opening it again creates another token.

Step 3: Join the master on the other server

On the future replica, open Web Services > Cluster and click Join a master.

Join a master

Click Join a master.
The replica checks the fingerprint of the master before it sends the token.
A wrong fingerprint stops the join and the token is not sent.

The replica then downloads the configuration of the master and applies it.
The first synchronization takes a few seconds.

The master page

The master page

A node can have five statuses:

Status Meaning
Up to date The replica runs the published version.
Synchronizing The replica is downloading or applying a version.
Failed The replica refused the last version and kept its previous configuration.
The last error says why.
Changed outside the cluster Someone changed the configuration of the replica by hand.
The replica applies the master version again.
Offline The master has not heard from the replica for 60 seconds.

The replica page

The replica page

The website pages of a replica are read-only.
A banner reminds you that the sites are managed on the master.

Website list of a replica

Any change sent to a replica is refused with this message: This node is a replica of the reverse-proxy cluster; make this change on the master.

Leave the cluster or become master

The Danger zone of the replica page has two actions.

Leave the cluster: the server becomes standalone again.
It keeps its current configuration and deletes its cluster certificates.
It also tells the master, which removes it from the node list.
You can join a master again later with a new token.

Leave the cluster

Become master: the server becomes the master of a new cluster with a new certificate authority.
Every other server must join it again.
Use it only if the old master is gone for good.

If the master stops, there is no automatic switch.
The replicas keep serving their last configuration.
After three failed contacts (about 30 seconds) they show The master cannot be reached.
They reconnect on their own as soon as the master answers again.

Troubleshooting

Warnings for the replicas

The master publishes a configuration that the replicas will refuse.
It warns you on its page, and the node shows Failed.

Warning on the master

Refusal on the replica

Message Cause Fix
backend N uses a node-local relay or socket, not supported in a cluster An enabled site uses a Docker Relay or a local socket backend. Disable that site, or remove that backend.
interface X of the master has no local mapping A site listens on a network card the replica cannot match by network or by name. Choose a card for X in Interfaces mapping on the replica.
master schema is newer, upgrade this node The master runs a newer version than the replica. Upgrade the replica.

The replica keeps serving its previous configuration in every case.
It applies again as soon as the master publishes a fixed version.

Join refused: the node is already enrolled

Join refused

The master still lists this server.
This happens when a replica left the cluster while the master could not be reached.
On the master, click the bin icon of that node and confirm.

Remove the node on the master

Then join again with a new token.

Other messages

Message on the replica What to do
The master cannot be reached Check the network and the firewall between the replica and the master port (9509 by default).
Removed from the cluster The node was removed on the master.
Join again, or leave the cluster.
the master certificate does not match the expected fingerprint Copy the fingerprint again from Add a node on the master.
A promoted master has a new fingerprint.
enrollment token is invalid, expired or already used Create a new token with Add a node.

Stopping the reverse-proxy service on a replica may take up to 5 minutes while it applies a version.
It never stops in the middle of an apply.
If it is killed anyway (power loss), it restores the previous configuration at the next start.