0

My current bargain CDN has very poor performance on video caching. What's worse, I don't have any access to its setting.

So I am wondering is it possible to rewrite the url for certain file type to my server's IP address instead the CDN server?

should be something like this in Apache: https://stackoverflow.com/questions/7154666/apache-mod-rewrite-redirect-file-type-to-another-domain

1 Answer 1

1

Add to your nginx config file somethink like:

location ~* \.(gif|jpg|jpeg)$ {
    rewrite ^(.*) http://someserver.com/$1 last;
}

You can see examples of nginx configuration of rewriting for example here and some examples of location directive here

2
  • Thanks, I also found this guide comes in handy, openlogic.com/wazi/bid/277439/…
    – KuN
    Jul 26, 2013 at 5:29
  • It works! Now my video are redirected to my vps rather than via CDN. Somehow "Localhost" didn't work as url in this case, so I used the static IP instead.
    – KuN
    Jul 26, 2013 at 6:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .