How to disable valid_referers?

Maxim Dounin mdounin at mdounin.ru
Wed Nov 10 16:45:32 MSK 2010


Hello!

On Wed, Nov 10, 2010 at 09:27:58PM +0800, Horus Lee wrote:

> Say if I have many files under / (document root), all of them need
> hotlink protection, except one.
> 
> I set valid_referers for location / as default, how could I skip the
> proection for the specific file?

location / {
    valid_referers ...
    ...
}

location = /some-specific-file {
    # no valid_referers directive here
    ...
}

See here for details:

http://wiki.nginx.org/HttpCoreModule#location

> I guess I can't simply put "valid_referers none" here according to the
> documentation at http://wiki.nginx.org/HttpRefererModule (It says
> default: none, but I guess this will confuse people with the value "none").

Yes, that's translation artifact.  Changed to "default: no", that 
should be more clear.

Maxim Dounin



More information about the nginx mailing list