CNAME other domain with my subdomain with masking

cname

#1

Hello,
im stuck with a particular issue here.

you see i have a ecommerce solution where each of my customer have their own site hosted on my subdomain. eg. site1.mysite.com, site2.mysite.com

now i want to have my customers own domain to CNAME with my sub-domain. eg. www.domain1.com will work as site1.mysite.com, www.domain2.com will work as site2.mysite.com

i tried with cludflare few things,
i added domain.com in cloudflare as CNAME
Name(domain.com) Value (site1.mysite.com)
it works actually, but when i type domain.com on browser, the url change to site1.mysite.com. is it possible to keep the url domain.com in browser something like url masking.

if its possible, please guide me a bit. if not possible in cloudflare, please suggest me how can i achieve that in alternative way.

thanks in advance.


#2

Sorry for the delay in response.

There are some security risks that prevent us from offering this. But I’ll pass along the feedback.


#3

Maybe proxypass on remote server would be a workaround but I’m not sure if this works well with Cloudflare domain (probably not).


#4

This can potentially be done with page rules using a host header override. Don’t believe that feature is available on the free plan.


#5

If I’m understanding correctly this is more an issue with your backend (i.e. site1.mysite.com config). Once Cloudflare is correctly directing traffic to your backend there is no reason why it can’t be displayed using that same CNAME but this would be via config on your host, not at Cloudflare. Have you tried to implement a RewriteRule or equivalent? Or as others have mentioned a reverse proxy in front of the sites to retain hostname. Depends what you’re using as a server but I don’t really see this as a DNS issue.


#6

Hell @saul
thanks for your reply.

Im on Nginx. could you please guilde me a bit in details? i am also wiling to hire a freelancer who could hire this for me. if you are free for freelancing, feel free to contact me over [email protected]