1
1
---
2
2
title : Create a custom DNS alias by setting up a reverse proxy
3
- description : Learn how to setup a custom DNS alias for your instance
3
+ description : Learn how to set up a custom DNS alias for your instance using a reverse proxy
4
4
date : 2025-05-16
5
5
tags : ['Server Admin', 'Security and Authentication']
6
6
keywords : ['custom DNS alias', 'DNS']
7
+ hide_title : true
7
8
---
8
9
9
10
{ frontMatter .description }
10
11
{ /* truncate */ }
11
12
13
+ <br />
14
+ <br />
12
15
# Custom DNS alias by setting up reverse proxy { #custom - dns - alias }
13
16
14
- In this knowledgebase article we will walk you through how you can set up a
15
- custom DNS alias for your ClickHouse Cloud instance by setting up a reverse
17
+ > In this knowledgebase article, we will walk you through how you can set up a
18
+ custom DNS alias for your ClickHouse Cloud instance through the use of a reverse
16
19
proxy such as Nginx for ClickHouse native client.
17
20
18
21
## Create a self-signed certificate { #create - certificate }
19
22
20
23
:::note
21
- This step is not needed if you are using signed certificates
24
+ This step is not needed if you are using signed certificates.
22
25
:::
23
26
24
27
Create a self-signed certificate with the domain name of your choice.
25
28
In this example we will use a domain name ` xyz-customdomain.com ` and
26
- create a certificate ` MyCertificate.crt ` .
29
+ create a certificate called ` MyCertificate.crt ` . Refer to [ "Create SSL certificates"] ( /guides/sre/configuring-ssl#2-create-ssl-certificates )
30
+ for further details.
27
31
28
- Add the following into ` /etc/clickhouse-client/config.xml ` :
32
+ Add the certificate to ` /etc/clickhouse-client/config.xml ` :
29
33
30
34
``` yaml
31
35
<clickhouse>
@@ -54,7 +58,7 @@ proxy_ssl_name xyz.us-west-2.aws.clickhouse.cloud;
54
58
proxy_ssl_server_name on;
55
59
```
56
60
57
- ```
61
+ ``` text
58
62
stream {
59
63
upstream stream_backend {
60
64
server xyz.us-west-2.aws.clickhouse.cloud:9440;
@@ -75,7 +79,9 @@ stream {
75
79
proxy_ssl_trusted_certificate /etc/ssl/certs/isrgrootx1.pem;
76
80
proxy_ssl_session_reuse on;
77
81
proxy_ssl_verify on;
82
+ #highlight-next-line
78
83
proxy_ssl_name xyz.us-west-2.aws.clickhouse.cloud;
84
+ #highlight-next-line
79
85
proxy_ssl_server_name on;
80
86
}
81
87
}
@@ -102,6 +108,8 @@ Where `10.X.Y.Z` is the IP address of your specific Nginx box.
102
108
103
109
## Connect to Cloud using alias { #connect - to - cloud - using - alias }
104
110
111
+ You are now ready to connect using your custom alias:
112
+
105
113
``` bash
106
114
clickhouse-client --host xyz.customdomain.com --secure --password ' xxxxxxx'
107
115
ClickHouse client version 23.12.1.428 (official build).
0 commit comments