hotel icon indicating copy to clipboard operation
hotel copied to clipboard

Using last level domain instead of top level

Open zaaack opened this issue 9 years ago • 5 comments

Using last level domain instead of top level to avoid cross domain issues like CDN pictures' referer check or CORS

zaaack avatar Jan 11 '17 08:01 zaaack

Hi @zaaack,

Not sure to understand what the question is, but subdomains (and wildcard subdomains) are supported.

hotel add 'cmd' --name domain # domain.dev
hotel add 'serve-assets-cmd' --name subdomain.domain # subdomain.domain.dev

Feel free to provide an example of what you want to do if it doesn't solve your issue :)

typicode avatar Jan 11 '17 12:01 typicode

@typicode For example,

my site is mysite.com, and the CDN service we used would check the referrer header' domain whether matching mysite.com or *.mysite.com to prevent other site from using our image, but the hotel's dev domain would be blocked too.

If we could put the dev before mysite.com like dev.mysite.com or dev.subdomain.mysite.com, the local site would have the same origin to online site, the CDN image won't be blocked and also avoid lots of cross domain issues, like cookies, ajax or some absolute path resource with online domain.

zaaack avatar Jan 11 '17 13:01 zaaack

Thanks for the explanation. I don't think there's a way to do this with current version of Hotel, but I'll see what I can do.

I suppose it's not possible to allow mysite.dev on the CDN?

typicode avatar Jan 11 '17 13:01 typicode

@typicode well, it might be configurable, but most company won't let development env influence the production env( and I don't have access ).

This also avoid cross domain problems, like ajax with an absolute url to using online data, or easily sharing login state if account server is separated.

zaaack avatar Jan 11 '17 14:01 zaaack

I'm running into a similar issue with our SSO systems. I need to run under the same domain in order for SSO to work. Has there been any workarounds found for this?

Sharondio avatar Dec 14 '18 00:12 Sharondio