HttpRefererModule long tail verification

toddlahman nginx-forum at
Thu Aug 25 23:07:05 UTC 2011

I am considering the following code to block image hotlinking, while
allowing Google images and Page Speed CDN Service access:

		location ~ \.(jpg|jpeg|gif|png|ico|flv|mp3|mpg|mpeg)$ {
			expires max;
			valid_referers blocked ~\.google\. ~\.googleusercontent\.;
				if ($invalid_referer) {
					rewrite ^;

Before I start using this code I'd like to know if it will allow long
addresses like the following two examples to properly gather images for
use on Google Page Speed (first example), and Google Images (second

Posted at Nginx Forum:,214310,214310#msg-214310

More information about the nginx mailing list