wildcards in valid_referers

Igor Sysoev is at rambler-co.ru
Tue Nov 27 09:10:43 MSK 2007


On Tue, Nov 27, 2007 at 12:53:53AM -0500, Ian M. Evans wrote:

> I just updated my nginx from the 4.x series and noticed that a line in 
> my config was causing errors.
> 
> One of the domains in my old valid_referers line was *.google.* to catch 
> all the variations (like images.google.com and all the national variants 
> like .ca, .co.uk, etc.
> 
> The 5.X series nginx doesn't seem to like that line. How should I change 
> it to make sure it catches all the google variants so I can exempt them 
> from my hotlinking check?

The old versions did not support it too, although they did not warn
about this. Now you may use regex:

   valid_referers    ~\.google\.  ;

Note the first '~'.


-- 
Igor Sysoev
http://sysoev.ru/en/





More information about the nginx mailing list