Create a custom DNS alias by setting up a reverse proxy
In this knowledgebase article, we will walk you through how you can set up a custom DNS alias for your ClickHouse Cloud instance through the use of a reverse proxy such as Nginx for ClickHouse native client.
Create a self-signed certificate
This step is not needed if you are using signed certificates.
Create a self-signed certificate with the domain name of your choice.
In this example we will use a domain name xyz-customdomain.com
and
create a certificate called MyCertificate.crt
. Refer to "Create SSL certificates"
for further details.
Add the certificate to /etc/clickhouse-client/config.xml
:
Update Nginx configuration
Add the following in your nginx.conf
file:
Where isrgrootx1.pem
is the root certificate for ClickHouse Cloud which you
can download here.
Update hosts file
The following step is not needed if you are using your own domain controllers
Add the following to your /etc/hosts
file on the Nginx server:
Where 10.X.Y.Z
is the IP address of your specific Nginx box.
Connect to Cloud using alias
You are now ready to connect using your custom alias: