Score:0

Different users coming through VPN to my service

mq flag

I have a web service (php, sql etc) running on an AWS account. I have openVPN setup, so users must establish the VPN connection, then the IP address will work.

I currently have this set as example123.noip.com which goes to 172.xxx.xxx.123

And this works.

My service is taking off, and I want to be able to offer it to other firms, BUT i want to be able to keep multiple firms hosted on the same AWS instance, but I would like to give each company a seamless experience, so for example I am thinking i can setup more noip addresses: clientcompany1.noip.com -> 172.xxx.xxx.123 clientcompany2.noip.com -> 172.xxx.xxx.123 clientcompany3.noip.com -> 172.xxx.xxx.123

So Mr X from Company3 goes to clientcompany3.noip.com and it will show his my service pages branded as Company 3... (they will not be aware other companies are hosted on that aws account)

(and some point I might need to add a separate AWS instance, and then I can just flip clientcompany3.noip.com -> 172.xxx.xxx.new address 456)

BUT - what is the best way to detect or route this within AWS? Do I just do some redirection detection from the HTTP headers using PHP? Is there a clever way to have traffic routed in with openVPN?

Andyj12 avatar
mq flag
My current thinking is that i use $SERVER['HTTP_HOST'] in a header on my PHP.
Score:0
mq flag

Ok, so I think the best way is to route my domain via Cloudflare.

I can then have subdomains defined as A records, routing to the private IP or public IP addresses for each service (so some users might have a static IP address which I can allow through the AWS firewall rules, so these are routed to the public IP address), whereas the rest have to activate the VPN and then that routes to the VPN private address.

My PHP header checks the SERVER['HTTP_HOST'] and will detect e.g. "clinicABC.example.com" and present the branding for ABC Clinic.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.