Custom Domain
A domain name, also known as a URL or web address, is the digital location where visitors can find your site. Every site or web service hosted on Back4app Containers automatically receives a free, unchanging b4a.run address.
Each site hosted on Back4app can be accessed through its unique Back4app subdomain, taking the form of [appName-userName].b4a.run. However, Back4app also offers you the flexibility to use your own custom domains with our Containers feature.
Managing custom domains with Back4app Containers is straightforward. We oversee the creation of TLS certificates and automatically redirect HTTP to HTTPS for all your custom domains, including wildcard domains.
Utilizing custom domains gives you the opportunity to make your sites accessible via unique domain names like www.yourcustomdomain.com or docs.example.dev. We support all top-level domains for your custom domains. Let's explore how to establish your domains on Back4app Containers!
The first step in setting up your Back4App containers is to register a custom domain. You can do this through any domain registration service of your choice. If you have not yet registered your domain, please do so before proceeding with the next steps.
Once you've registered your domain, you can add it to your Back4App containers. Here's how you do it:
- Navigate to your app on Back4App Containers.
- Go to Settings
- Click on the Domain tab
- Enter your registered domain in the provided field.
Following these steps, Back4App will provide instructions on how to add the records to your DNS server.
This domain is now waiting for External DNS propagation (that can take up to 24 hours) or has not been configured properly. Confirm you have configured this domain properly with the suggestions below.
Recommended: Point ALIAS, ANAME, or flattened CNAME record the given custom.b4a.run URL.
Create an ALIAS, ANAME, or flattened CNAME record for your domain pointing to the given custom.b4a.run URL. Examples:
Type | Name | Target |
---|---|---|
CNAME | www | 123456.custom.b4a.run |
ALIAS | @ | 13456346.custom.b4a.run |
ANAME | mysubdomain | 62345.custom.b4a.run |
After adding the new records on your DNS server Back4app will validate the configuration and then will start to generate a SSL certificate. Notice that DNS propagation can take up to 24h.
You can also set up redirect domains on Back4App.
You can configure domain redirects to all domains configured on Back4app Containers to your App.
Configuring the domain congnitivengine.com to reply as www.cognitivengine.com on Back4app Containers. In this example we will use CloudFlare as the DNS server.
Add www.cognitivengine.com to the Back4app Containers and copy the given custom.b4a.run URL.
Now, you need configure the DNS server to recognize your new domain. Create a new CNAME record using www on Name field and the given custom URL on Target. Check the image below.
After that, Back4App will detect the new DNS configuration, validate it, and then start the process of generating the certificates. Once the certificate generation and validation are completed, you will see a confirmation.
Now you can set up the cognitivengine.com domain as a redirect to www.cognitivengine.com.
Go to your DNS server and configure the root domain as described below:
- Add a new CNAME record on your DNS server using these values.
- Use the "@" symbol (which is used for root) and the address value generated by the Back4App domain.
- Turn on the proxy option.
That's it! Now you've successfully configured your domain and subdomains on Back4App containers. Remember, each step is essential to ensure the correct functioning of your domain and subdomains.