2

Assume I have a domain http://go.example.com/abcdefg when example.com is server running on NGINX. The main task of that server is to proxy pass all visitors to other server and then, this other server redirects person to specific, predefined link (fetched from database).

I am planning on creating interface that will allow them to add their own domain. These domains will be stored in database (mysql in my case), and the NGINX config file will be created based on the domain name user specified earlier using predefined template in sites-enabled folder. Same goes for deletion.

Once user adds either A or CNAME records to his domain (whichever works best, perhaps you can explain me what works best in this case?) that will point to specific IP address or domain, his domain should become accessible and behave the same way, go.example.com does.

For example, assume user added domain http://foo.com, then all user accessing http://foo.com/abcdefg will redirect to the same link, go.example.com/abcdefg does.

What I am trying to achieve is allow users to override our domain name, and use their own instead that will behave exactly as our original domain. This process needs to be controlled so the domain name could be disabled if needed.

I am asking if this is the proper way to go or perhaps there is a better way to automate "domain parking"?

5
  • Does the URL that parked domains resolve to matter? If not, you can configure parked.example.com as the default site in Nginx and put a simple landing page there. Once users point their A records to your server, Nginx will serve them the default site since their request doesn't match anything else. May 23, 2014 at 11:21
  • The question isn't too clear. From "For example, assume user added..." can you explain what the objective of this task is? What are you trying to accomplish?
    – Joe
    May 23, 2014 at 18:55
  • Joe, I tried editing out a question a little bit to point out what I am trying to achieve. Hope it's at least a little bit more clear now. Tom, Is there any way I can control this process then? for example I know that this particular users, uses his domain "blabla.com" to point at out servers, so we can disable it if needed.
    – Screatch
    May 23, 2014 at 21:30
  • Good job, I remember flagging your old question as off-topic on SO.
    – bjb568
    May 24, 2014 at 7:42
  • How to configure and implement a web application for any specific application is too large of a task to be answered from a single question. Maybe you could narrow it down to something more answerable? For example, you could ask about the rewrite rules that you have tried. Jun 23, 2014 at 13:45

0

Browse other questions tagged or ask your own question.