Welcome! Log In Create A New Profile

Advanced

hotlink protection with rewrite

Posted by vicky007 
hotlink protection with rewrite
January 10, 2010 08:03AM
Hello,

I'm new to nginx and I really like it so far. However, I have problems with hotlink protection I used on apache.

I protect swf and flv files as follows:

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?mydomain1.com(/)?.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://(www\.)?mydomain2.com(/)?.*$ [NC]
RewriteRule \.(flv|swf)$ http://www.someotheromain./hotlink.swf [L,NC]

I can prevent hotlinking in nginx, but do not know how to do the rewrite part. The result should be that if someone hotlinks some of my flash content It will display the hotlink.swf file to him.

Thank you for help.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 120
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready