Is there any standard, convention or practice that governs the use of static file server domains?

4

I have the following scenario:

Each customer of my service (SaaS) has a custom url. For this, I created a CNAME record *.dominio.com pointing to my server.

Eg: empresa1.dominio.com , empresa2.dominio.com , etc.

For static files, I created another CNAME record pointing to my static file server as follows: *.static.dominio.com , to contain the company url.

Eg: empresa1.static.dominio.com , empresa2.static.dominio.com , etc.

In practice, these subdomains point to the same file server.

I would like to know if there is any convention about this scenario, if it would be a bad practice, if it would be better to just leave static.dominio.com , or make no difference at all.

    
asked by anonymous 15.05.2015 / 17:11

1 answer

1

For HTTP, it makes no difference. The problem is when it involves HTTPS, and the trend is for the Web to migrate to HTTPS, so it would be good to predict the layout of domains to make things easier.

An HTTPs certificate can be "wildcard", say * .company1.domain.com, this certificate could be used on the static server static.company1.domain.com, but not if the server is enterprise1.static.domain.com . In the latter case it would be another certificate and the browser may complain because the content is coming from two domains with different identity (certificate).

The fact that the names point to the same server is not a problem, since HTTPS servers can also serve different domains on the same IP for some time (SNI extension). Maybe in the case of HTTPS it would be necessary to use a DNS A record per client, not CNAME because CNAME really does rename another, and then we return to the previous problem.

    
08.09.2015 / 04:26