this is the case. For example, aaa.com represents the primary site, and bbb.aaa.com is a sub-site. Now I have mapped ccc.com to bbb.aaa.com, through CNAME on Tencent Cloud, while accessing ccc.com does not jump to bbb.aaa.com. Nginx is used as the proxy in the background. The specific configuration is as follows
server {
listen 8081;
server_name *.aaa.com;
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-Ip $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
if ($host = "aaa.com") {
proxy_pass http://127.0.0.1:8000;
}
if ($host = "www.aaa.com") {
proxy_pass http://127.0.0.1:8000;
}
if ($host ~ ^(\b(?!www\b)\w+).aaa.com$) {
proxy_pass http://127.0.0.1:8080;
}
}
}
visiting ccc.com returns the welcome page of nginx. I don"t know much about