Skip to content

Commit 3a33549

Browse files
Cinzyaclaude
andcommitted
docs(domains): add path-based routing documentation
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 9e990a7 commit 3a33549

File tree

1 file changed

+39
-1
lines changed

1 file changed

+39
-1
lines changed

docs/knowledge-base/domains.md

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Domains
3-
description: "Add custom domains to Coolify with FQDN format, multiple domain support, port mapping, wildcard domains, and custom DNS server validation."
3+
description: "Add custom domains to Coolify with FQDN format, multiple domain support, port mapping, path-based routing, wildcard domains, and custom DNS server validation."
44
---
55

66
# Domains
@@ -39,6 +39,44 @@ If automatic certificate issuance from [Let's Encrypt](https://letsencrypt.org?u
3939
If you see a certificate warning in your browser or your application shows a self-signed certificate, see the [Let's Encrypt Not Working](/troubleshoot/dns-and-domains/lets-encrypt-not-working) troubleshooting guide for detailed solutions.
4040
:::
4141

42+
## Path-Based Routing
43+
44+
You can route traffic to different applications and services based on URL paths by appending a path to your domain. This allows multiple applications to share the same domain while being accessible at different paths.
45+
46+
**Format**: `https://domain.com/path` or with a custom port: `https://domain.com:3000/path`
47+
48+
::: warning PORT PLACEMENT
49+
When using both a port and a path, the port must come **after** the domain but **before** the path.
50+
51+
- Correct: `https://coolify.io:3000/api`
52+
- Incorrect: `https://coolify.io/api:3000`
53+
:::
54+
55+
### How Path Priority Works
56+
57+
Coolify automatically applies priority rules to path-based routing. More specific paths take precedence over less specific ones:
58+
59+
- `/api/v2/users` → highest priority
60+
- `/api/v2` → medium priority
61+
- `/api` → lower priority
62+
- `/` → lowest priority (root/fallback)
63+
64+
This means you can safely deploy multiple applications on the same domain without worrying about routing conflicts.
65+
66+
### Health Requirements
67+
68+
For path-based routing to function correctly, the application serving a specific path must be **running and healthy**. If an application becomes unhealthy or stops responding, traffic to that path will fall back to the application serving the root domain (`/`).
69+
70+
::: tip EXAMPLE
71+
If you have:
72+
- App A serving `https://coolify.io/` (root)
73+
- App B serving `https://coolify.io/api`
74+
75+
And App B becomes unhealthy, requests to `/api` will be routed to App A instead.
76+
:::
77+
78+
Read more about how Coolifys proxies read and intepret the health of your resources in our [Health Checks page](/knowledge-base/health-checks).
79+
4280
## Catch Multiple Domains
4381

4482
Multitenancy is supported with Coolify. When using [Traefik](/knowledge-base/proxy/traefik/overview), you can automatically catch multiple domains, by editing the `Container Labels` of your Application or Service and define a [`HostRegexp`](https://doc.traefik.io/traefik/reference/routing-configuration/http/routing/rules-and-priority/#host-and-hostregexp) rule.

0 commit comments

Comments
 (0)