1

My application serves landing pages and we need users to custom CNAME it

eg: {{userdomain}}.myapp.com/{{pageid}} serves the landing pages today.

User wants to map it to {{landing}}.theirsite.com

So, we allow them to cname it to {{userdomain}}-{{pageid}}.myapplanding.com

I am trying to use nginx as proxy the requests to the page. Another reason for me to use nginx is to allow SSL certs by the user as it's difficult to configure on the cloud service we use for myapp.

server {
    listen 80;
    server_name *.myapplanding.com;
    # server_name {{userdomain}}-{{pageid}}.myapplanding.com (I want userdomain and pageid to be parsed and proxied

    location / {
        proxy_pass https://????; // What goes here? It should forward to https://{{userdomain}}.myapp.com/landing/{{pageid}}
    }
}

Thanks.

cloudpre
  • 111
  • 2

1 Answers1

0

Finally, we asked all users to cname it to landing.myapp.com; nginx proxy got the request URI and sent it to the upstream server which looked up the db and served the right page. There was no custom cname for each user.

cloudpre
  • 111
  • 2