Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

If I'm using a sub-domain for my clients access to a web application (e.g. client-x.example.com/admin/), and I want client's to optionally use their own domain (e.g. client-x.com), do you think it is advisable to have them point their www CNAME to client-x.example.com/admin/ and forward all http://client-x.com/ to http://www.client-x.com/ so thatclient-x.com is always accessed via the www version? I may need to offer SSL on their sub-domain as well as on their main domain.

Are there issues I should be concerned about with this simplified approach?

Also, will I be able to tell which sub-domain they're main domain is pointed to from my web server (NGINX), or will I have to create a table for domain-to-subdomain relationships?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

from a URL perspective the domain CNAME could work. However, depending on your webserver you should be able to create for example a virtual host in apache that listens for either the domain or subdomain address and so all that would be needed is a proper A record in their DNS.

As for the mapping. I don't know how CNAME works with browsers my guess is that the browser queries the web server using the real address not the CNAME so you would only see requests for the subdomain not for the domain and so wouldn't be able to tell if someone typed the subdomain or was forwarded by dns.

also regarding SSL I believe you can't share the same IP for 2 two certs so your webserver will show your domain and the browser will probably bitch.

share|improve this answer
    
thanks. I was worried about the SSL thing, but it's not a huge deal. SSL certs for clients might not happen any ways. Secure stuff currently takes place another domain that maps to the application. And, the A Record stuff is great. I didn't even think about just using my own web server to forward requests. I suppose I won't even need to forward requests if I'm listening for their domain. I just map that back, pull it from the DB the same as I would after stripping the www. from the host. Thanks again. –  orokusaki Oct 3 '10 at 23:21

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.