With the hosting feature you can serve your website (html, css, js, images) right from your Baqend cloud instance while using your own domain.
Public File Access
All assets stored in the www root folder can be accessed under your app domain (
<appName>.app.baqend.com) as in the following examples:
||File Name (
To deploy your assets, you can either use the file explorer in the Baqend dashboard (e.g. drag and drop files and folders) or the Baqend CLI for an easy, automated deployment.
To serve your website under your own domain, you have to create a DNS entry and register the custom domain in your Baqend dashboard:
Log into the account at your domain provider and add a CNAME rule like the following to your DNS entries:
www.yourdomain.com. IN CNAME <appName>.app.baqend.com.
Note: You should not use a top level domain as a CNAME, since many DNS providers do not support it. Instead use a sub domain such as www.yourdomain.com. In addition you should ensure that no other DNS-entry is set for the used domain.
Log into your Baqend dashboard and open your app settings. In the Hosting section, simply add your custom domain
www.yourdomain.comand click the save button. Your domain will now be registered at the CDN. Instead of
<appName>.app.baqend.comyou can now use
Optionally, you can define a custom Domain root folder (default:
www). This allows you to host multiple pages on the same Baqend app. Just specify a different file root folder and its content will be served by your custom domain.
Consult your DNS provider's instructions to configure the CNAME record for your domain name. The steps to add a CNAME record will vary for each registrar's control panel interface.
If you cannot find your provider's CNAME configuration instructions, Google maintains instructions for most major providers.
www) you should create four A records which point to our Anycast IP addresses:
yourdomain.com. IN A 126.96.36.199 yourdomain.com. IN A 188.8.131.52 yourdomain.com. IN A 184.108.40.206 yourdomain.com. IN A 220.127.116.11
Single Page Apps
If you use the History API of your single page app framework (like Angular2 or React), you need to host your
index.html also as
404.html. This leaves you with the two identical files:
||File Name (
|www||404.html||Every URL where no file is hosted|
If a user for example directly opens a URL like
http://yourapp.com/products/42 this request needs to be handled by the single page app because there is no hosted HTML file under
404.html is returned whenever no hosted file is found for a URL (like
http://yourapp.com/products/42). By hosting the same code in both your
404.html all entrypoints will be correctly handled.
All data accessed over the Baqend SDK can be SSL-secured by enforcing encryption at connect.
To enable SSL encryption for your hosted assets as well, generate and activate an SSL certificate for your custom domain.
To this end, navigate to the "Hosting" section in the dashboard settings.
Here, do the following:
- Click on "Request SSL certificate":
This will queue your request for later activation. If you plan to request more than one SSL certificate, request all of them first and then activate them in one batch (see next step).
- Click on "Activate SSL certificates":
You may activate several certificates at once, but you may only start 2 activation processes per day.
By confirming the activation dialog, your SSL certificate will be activated. Your custom domain is now reachable via
Behind the curtains, we are using Let's Encrypt to automate the entire process.
Protect your Website with Basic Authentication
It is quite common to protect QA or staging environments with Basic Authentication,
also known as
If you open the dashboard, navigate to
files, and click the
Edit Root Folder ACL button, you can restrict the
load permission to
specific roles and/or users.
For example, if you assign the load permission to the
loggedIn role, only logged-in users will be able to access content hosted in the corresponding directory.
New Users can be created in the Dashboard Data > User table.
When permissions other than
Publicare assigned, any unauthorized access to the hosted website is prevented:
When loading a protected site, the accessing user will be asked for login credentials through the browser-native authentication prompt.
After successful login, a cookie will be set to keep the user logged in for 30 days per default.
(The login period can be changed in the dashboard under Settings > Authentication > User Session Length)
Here are your advantages at a glance:
- The certificates are deployed directly at the CDN which makes the initial handshake superfast.
- Once activated, your SSL certificates will be renewed automatically, so you don't have to maintain them yourself.
- HTTP/2 is activated by default to make your website as fast as possible.