Manage an app's domain names
An app’s domains determine which requests are routed to the app. If an app has no domains, the app cannot receive requests.
An app’s domains are also used for AutoSSL.
Types of domains
The following are valid domains you can add to your app:
- Apex domains such as
example.com
- Subdomains such as
dev.example.com
- Wildcard domains such as
*.example.com
- IP addresses such as
203.0.113.44
Using IP addresses as domains
Adding your server’s IP address as one of your app’s domains allows you to preview the app using the server’s IP address as the domain name in your browser.
To preview multiple apps on the same server, use subdomains
such as preview.example.com
.
Wildcard domain precedence
Non-wildcard domains have precedence over wildcard domains. For example, when using the following:
- “app1” has domain
*.example.com
- “app2” has domain
dev.example.com
Requests for dev.example.com
will be routed to “app2”
and requests for all other subdomains of example.com
will be routed to “app1”.
Manage domains
Add a domain
To add a domain to an app:
- Go to the Apps page in the dashboard and click on the name of the app.
- Click on Domains.
- Enter the domain in the Add Domain form.
- Click on Add Domain.
Remove a domain
To remove a domain from an app:
- Go to the Apps page in the dashboard and click on the name of the app.
- Click on Domains.
- Click on the ⓧ icon next to the domain you want to remove.
Duplicate domain behavior
ServerPilot allows adding the same domain to multiple apps. This functionality can be used to move a domain to a different app with zero downtime by first adding the domain to the new app and then removing the domain from the original app.
When the same domain is added to multiple apps on the same server, requests for the domain will be routed to the app whose app name is alphabetically first.
Accept requests for all domains
To accept requests for all domains without adding domains to an app:
- Create an app with an app name that is alphabetically first among the apps on the server.
- Go to the Servers page and click on the name of the server.
- Disable Deny Requests for Unknown Domains and click Update Settings.
Internationalized Domain Names (IDNs)
Internationalized Domain Names (IDNs) are domain names that contain non-ASCII characters. To use IDNs, add the Punycode representation of the domain name to the app in ServerPilot. Use a Punycode converter to get the Puncycode representation of a domain.