Instead of using cdn1.domain.com, cdn2.domain.com, cdn3.domain.com, what if I used a different domain like img_domain.com? I see multiple benefits.
1. I will get all the benefits of parallel
2. img_domain can be served by a different server if I wish like lighhttpd or ngix etc and can reduce the load on apache.
3. I can serve this domain cookie free further improving network to and fro traffic.

Any thoughts?

Comments

mikeytown2’s picture

You can do this, I know people who do use it this way. You have to be certain that all files are on that domain though. So a pull CDN works great in this situation, or just make sure both web servers point to the same dir & make sure lighttpd or nginx has the correct permissions (so no one can read your settings.php file).

ajayg’s picture

Thanks for pointing about the correct permission. I have never thought about that. You just saved me from a big potential security risk. Looks I will need something very similar to .htaccess file for whatever server I choose to use.

Since you metioned you know some people use this way, either they or you or someone else can please provide more details about how to set this up?

ball.in.th’s picture

subscribing. interested in the proper way to set up nginx also.

okokokok’s picture

If you simply ditch Apache and go for nginx+php-fastcgi it's already set up properly!

Otherwise you can add something like

# deny access to .php files
location ~ /\.php$ {  deny all; }

# deny access to backup files
location ~ ~$ {   deny all;  }
wim leers’s picture

Status: Active » Closed (fixed)