3 messages in ru.sysoev.nginxquestion revarding referers
FromSent OnAttachments
Stefanita Rares DumitrescuApr 29, 2008 1:57 am 
RoxisApr 29, 2008 2:14 pm 
Stefanita Rares DumitrescuApr 29, 2008 10:59 pm 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:question revarding referersActions...
From:Stefanita Rares Dumitrescu (katm@public.gmane.org)
Date:Apr 29, 2008 1:57:30 am
List:ru.sysoev.nginx

i have a question here:

i have a download website, and i prohibited hotlinking by using the valid_referer parameter:

location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|flv|txt|zip|mp3|rar|w3x)$ { if ($invalid_referer) { #return 403; rewrite / http://www.mysite.com/; } root /home/account/public_html; expires 30d; }

the problem is that if the extension is changed, for example JPG or JpG, the location regex does not work. it's case sensitive.

would this work ?

location ~* ^.+.(*)$ {

instead of location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|flv|txt|zip|mp3|rar|w3x)$ {

so that all files are protected against hotlinking?