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.

4
  • You need to make this much more concrete. How do you expect to embed a URL path (pageid) into a DNS label? Commented Oct 5, 2015 at 13:43
  • There will be runtime instructions to provide the pageid which the users will setup in their DNS. Commented Oct 5, 2015 at 13:56
  • Or I can add a http header of the request and let the end app serve the page looking at this header. Commented Oct 5, 2015 at 14:00
  • Your server will get {{landing}}.theirsite.com as Host and will have no idea what pageid or userdomain are. Commented Oct 6, 2015 at 7:39

1 Answer 1

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.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.