Skip to content

A backup server abroad: failover for your cascade

Created: November 23, 2026.

The main balancer and Observatory forms were checked against the 3x-ui 3.12.0 source code on November 30, 2026. You need to verify actual switching between exits on your own network.

Why use failover and what will you achieve?

Suppose you already have a working cascade across two VPS instances: your devices connect to a Russian server, which forwards selected traffic through a server in Finland. If the server abroad stops responding, the route that depends on it stops working.

You can add a third VPS, for example in Sweden, and configure failover: use the primary exit in Finland while it is available, then send new connections through Sweden when the checks detect a failure.

Phone → Entry VPS in Russia → Routing rules
                                  │
                                  ▼
                               Balancer
                                  │
                 ┌────────────────┴───────────────┐
                 ▼                                ▼
          Primary: Finland                  Backup: Sweden
             cascade-exit                     backup-se
                 │                                │
                 └────────────► Internet ◄────────┘

After following this guide, you do not need to change client profiles or subscriptions. Xray on the Russian VPS selects the exit server. The cascade's Russian exceptions remain as you configured them.

You will also learn how failover differs from ordinary load balancing, how to check the Observatory, how to test the backup manually and how to return to the original configuration.

Contents: Requirements · Create the balancer · Availability checks · Routing · Test failover · Rollback.

1. How failover differs from load balancing

An outbound is a configured route from your VPS to the internet or another server. A balancer is an object with its own tag that selects an outbound. A routing rule determines when to use that balancer.

3x-ui offers these strategies:

Strategy Purpose
Random Distribute new connections randomly among candidates
Round robin Select candidates in turn
Least ping Select the available exit with the lowest measured latency
Least load Select using more advanced probes and estimated load

Two other fields are important for our goal:

  • Selector - the candidates among which the strategy normally chooses. Add only the primary cascade-exit.
  • Fallback - the backup outbound Xray selects if the strategy cannot choose any candidate. Set it to backup-se.

Why not put both servers in Selector? In that case, Least ping could choose Sweden simply because its current latency is lower, even if Finland is fully operational. We want a different result: Finland takes priority, and Sweden is used if it fails.

The Least ping strategy uses the Observatory results. If the primary exit is marked unavailable, the strategy has no candidate to select and uses Fallback. This is not a switch with zero packet loss: existing connections may be interrupted, and failure detection takes time.

2. What you need to prepare

  1. A working cascade on the Russian VPS with the cascade-exit outbound to the primary VPS abroad.
  2. A backup server added using the outbound server guide, with the new outbound named backup-se.
  3. Both routes pass the HTTP test separately under Xray → Outbounds.
  4. Under Xray → Routing, the CASCADE - EXIT rule currently points directly to cascade-exit.

Do not create the balancer until these four requirements are met. Having a backup outbound without a working connection will not protect you against primary server failure.

Preserve the working configuration

Back up your settings before making changes. Changing rules on a working server may briefly interrupt connections. Do not delete the cascade-exit and direct outbounds, the cascade client or the panel's service rules.

3. Create the balancer

Perform all the following steps in the web panel of the Russian entry VPS.

  1. Open Xray → Balancers, then the balancer settings tab.
  2. Click + Balancer.
  3. Enter cascade-failover in the Tag field. This is the new balancer's name, not a VPS address.
  4. Select Least ping as the Strategy.
  5. In Selector, select only cascade-exit, the primary server in Finland.
  6. In Fallback, select backup-se, the backup server in Sweden.
  7. Click Create.

The following row should appear in the list:

Tag Strategy Selector Fallback
cascade-failover Least ping cascade-exit backup-se

Check these exact values. Xray matches selectors against outbound tag prefixes. If you have created other outbounds whose names begin with cascade-exit, they may also become candidates. Resolve such conflicts by renaming your custom outbounds or adjusting the design first; do not assume exact equality.

4. Configure availability checks: Observatory

Open the Observatory tab in the balancer section. The 3x-ui panel automatically creates and associates the Observatory with the Least ping strategy. For ordinary failover, there is no need to write Observatory JSON manually.

Example probe URL (copy it into the probe URL field):

https://cp.cloudflare.com/generate_204

Check the following:

  1. Monitored outbounds: cascade-exit should be among them. It comes from the balancer's Selector.
  2. Probe URL: use the address above or another reliable URL you can access. The server should respond with HTTP 204, and the request must pass through the outbound being tested.
  3. Probe interval: start with 1m, approximately one check per minute.
  4. Concurrent probes: you can leave them enabled. This allows several monitored exits to be checked at the same time.

Least ping uses the Observatory's availability and latency information for the selected outbounds, rather than merely the results of a TCP connection test.

What this does not guarantee: a successful HTTP probe to one site does not prove that every internet service is available. Conversely, a failure at the probe URL may cause failover even when the primary server is otherwise working. Choose a stable URL that is actually reachable through your VPS abroad.

The backup backup-se is not in Selector, so this balancer is not required to monitor its availability in advance. Run a separate HTTP test on the backup outbound before configuring Fallback. Fallback does not turn the third server into another automatically monitored chain of backup exits.

5. Connect the balancer to routing

This step is mandatory. Creating a balancer is not enough: while CASCADE - EXIT points directly to cascade-exit, the new balancer is not involved in route selection.

  1. On the Russian VPS, open Xray → Routing and the rule list.
  2. Find CASCADE - EXIT (after the Russian exceptions CASCADE - RU and CASCADE - RU2).
  3. Click the pencil icon.
  4. Clear the Outbound tag (outboundTag) field, currently set to cascade-exit.
  5. In the Balancer (balancerTag) field, select cascade-failover.
  6. Do not change the network: tcp,udp condition or the CASCADE - EXIT remark.
  7. Save the rule, then click Save on the main Xray page.

The rule should now point to a balancer, rather than specifying both an outbound tag and a balancer.

CASCADE - RU   → direct
CASCADE - RU2  → direct
CASCADE - EXIT → cascade-failover
                  ├─ Selector: cascade-exit (primary)
                  └─ Fallback: backup-se (backup)

Why edit the existing rule rather than add another? CASCADE - EXIT is already the general cascade route. A duplicate broad rule could intercept traffic before the intended conditions and confuse rule order.

Russian exceptions are preserved: CASCADE - RU and CASCADE - RU2 still send matching requests directly from the Russian server. If you want to change this behavior or use the backup only for selected sites or clients, read the routing guide.

6. Test the primary server and failover

1. Selected target. Under Xray → Balancers → Balancer settings, find the cascade-failover row. Check the current target column. Once the primary exit is available and successful probes have been collected, expect cascade-exit.

2. Force selection of the backup.

  1. Find Override in the balancer row.
  2. Temporarily select backup-se.
  3. From a device connected to the Russian VPS, open a public IP checking service. With ordinary direct egress, it should show the Swedish VPS's IP. Remember that Russian sites may still match CASCADE - RU / RU2, and WARP on the exit server can change the public IP.
  4. Return Override to Auto (strategy). Do not leave the backup forced after the test.

Manual Override tests the route but does not prove automatic failover.

3. Optional: test automatic failure and recovery. If you have separate test VPS instances or an agreed maintenance window, temporarily make the primary exit unavailable without modifying SSH or deleting the server. Wait until Observatory reports the failure and the balancer selects Fallback. Open a test resource through the cascade and check the public IP. Then restore the primary exit, wait for successful probes and verify that the target returns to cascade-exit.

Do not deliberately cause an outage on your main working VPS just to follow this guide. Without this test, you can say only that the configuration was saved and manual selection works, not that automatic failover has been verified.

7. What happens during a real failure

  • The Observatory checks the primary cascade-exit periodically.
  • If it is no longer considered available, Least ping cannot select a candidate from Selector.
  • The balancer uses backup-se as Fallback for new connections matching the rule.
  • When a new probe cycle confirms the primary has recovered, the strategy can select cascade-exit again.

Failover is not instantaneous: a 1m interval means periodic checks, not a guarantee of switching in exactly 60 seconds. Existing TCP/UDP sessions may need to reconnect. If the backup is also unavailable, it cannot automatically restore connectivity.

8. Undo failover without breaking the cascade

To return to the ordinary setup with one VPS abroad:

  1. Open CASCADE - EXIT under Xray → Routing.
  2. Clear the Balancer field and restore cascade-exit in Outbound tag.
  3. Save the rule and the overall Xray configuration.
  4. Open Xray → Balancers, delete cascade-failover and save again. Do not delete unrelated balancers. The panel automatically manages the Observatory if no strategy needs it anymore.
  5. If you no longer need backup-se and no other rules reference it, delete it from Xray → Outbounds and save Xray. You can then disable the dedicated client on the backup VPS.

Before disabling Cascade through the project menu

The 3X-UI AUTO NGINX manager accounts for dependencies on cascade-exit in custom balancers. If a balancer still references cascade-exit, disabling Cascade may be blocked to avoid leaving broken references. Restore routing and remove the dependent balancer first, then use the standard 5. Cascade → 4. Disable menu if needed.

Use the third server for more than failover

You can also use backup-se in individual routing rules, for example to route YouTube, a selected client or an entire XHTTP inbound through it while the rest of the traffic uses the Finnish cascade. See the 3x-ui routing guide for detailed examples.


Import a third server · Traffic routing · Cascade across two VPS instances

Attribution and use of materials

© 2026 xPROMSx contributors · 3X-UI AUTO NGINX

Our material may be copied and distributed under the GNU GPL-3.0-only license, provided the attribution and link to the original are retained.

Original source: https://xpromsx.github.io/3x-ui-auto-nginx/guides/balancer/

Terms of use for project materials