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: 94
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready