d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Implementing 3000 Domains > This Is Getting Messy
Add Reply New Topic New Poll
Member
Posts: 4,351
Joined: Mar 11 2017
Gold: 0.00
Sep 14 2017 07:39pm
Hi, i'm in need of opinions and assistance for implementing mass web domain sites.

Basically, we have an idea that allows for 3,000+ different sites which is specific to a certain let's just say "disease".
We already have 6 "disease" websites up, all on separate services, domains, and that each have their own back-end/front-end systems (300+ html pages each).

Now, just dealing with 6 of these is rather tedious.. I'm already swamped for time in doing minor changes in every site individually.

My question is:

How can I create 3,000+ of these "disease" sites that allow for dynamic content and change, WITHOUT having to go in individually and change each one.

Currently i'm using:

- Nodejs , EJS (Partials, templating).
- Digital Ocean.


Please don't tell me to switch technologies/languages because i'm already in so deep. And honestly, it shouldn't matter what languages I use because this is more a design/pattern architectural solution.

Thank you for any advice/guidance/thoughts/solutions/fandom.

:)
Member
Posts: 3,197
Joined: May 4 2013
Gold: 1,457.00
Sep 15 2017 09:41am
Well, point all of the domains at one backend, and in the backend retrieve front page, texts etc related to domain people are visiting? + Probably default pages that will apply to all sites, default templates and such.

And then to manage it, use something like ansible, puppet, salt... preferably also dockerize it for easy deployment anywhere, any time
Member
Posts: 4,351
Joined: Mar 11 2017
Gold: 0.00
Sep 16 2017 06:17pm
Quote (nuvo @ Sep 15 2017 07:41am)
Well, point all of the domains at one backend, and in the backend retrieve front page, texts etc related to domain people are visiting? + Probably default pages that will apply to all sites, default templates and such.

And then to manage it, use something like ansible, puppet, salt... preferably also dockerize it for easy deployment anywhere, any time


How do I point all of the domains to one back-end..?
Could you give me an example in NODEJS?

:D
Member
Posts: 3,197
Joined: May 4 2013
Gold: 1,457.00
Sep 17 2017 05:17am
It's not in the nodejs. Okay, crash course:

- you buy a domain at a registrar. Each domain has its nameservers.
- when you lookup domain, say example.com, your browser checks what nameservers are handling that domain, and then ask those nameservers where the domain points, at what IP (+caching of stuff etc. doesn't matter here)
- you can use registrar's nameserver, some hosted like cloudflare or your own. It doesn't matter. But with 3000 domain your own is by far the easiest way.
- at nameservers you set domain to point to your server's ip, say 1.2.3.4
- repeat 3000 times
- when server receives request, the HTTP HOST header will contain the domain user typed. In nodejs + express for example, you can get it with

Code
request.headers.host


use that variable to decide which content to show. Note that www.example.org and example.org are separate, so you can eg. strip "www." part from request.headers.host first.
Member
Posts: 2,307
Joined: Feb 9 2015
Gold: 0.91
Sep 18 2017 10:47am
incredible
Go Back To Programming & Development Topic List
Add Reply New Topic New Poll