Rewriting jpg with specific google referer to 1 pixel gif

Ian M. Evans ianevans at
Mon Feb 18 01:39:02 UTC 2013

If I understand correctly, nginx doesn't do multiple conditions in an 'if'
or nested if's.

Based on some of the ideas being tossed around in this thread
( I'd like to
rewrite serve up a one pixel gif to whenever both of the two following
conditions are met:

1) The http referer is*/blank.html(*) and then

2) the requested asset is a jpg

What's the best performance way to handle that?

* I suck at regex, so I just put the asterix there to signify catching any
of the google country domains.

Thanks for any suggestions.

More information about the nginx mailing list