Someone has setup a CDN server which is directing traffic to my server and setting the HOST header to match one of my real domains. Because of this, Apache uses the virtual host for my real domain name instead of the host name for the CDN domain.
For example, the URL is:
http://cdn.example.com/pictures/www.mydomain.com/images/product/6a/229326.jpg
It appears this CDN is a proxy that is overriding the HOST header. Apache sees the host as www.mydomain.com instead of cdn.example.com.
I'd like to block this traffic, but I can't block via host or IP (because it changes). There is a host header:
HTTP_X_FORWARDED_HOST=cdn.example.com
Possible?
edit: don't have mod_security installed
You can use mod_rewrite to accomplish this task:
As you can see, if you test it with curl denies the access: