Welcome! Log In Create A New Profile

Advanced

exclude invalid_referrer directory

Todd HG
January 01, 2011 11:14PM
I use the following code block to redirect invalid referrers back to the
homepage when someone attempts to view an image directly on my Wordpress
blog.

I would like to be able to use /var/www/blog/wp-content in the code
block below for the invalid referrers, and have another code block such
as /var/www/otherimages that does not redirect or block any referrers.
/var/www/otherimages could be viewed by anyone even directly. How would
I write this second code block?

location ~ \.(jpg|jpeg|gif|png|flv|mp3|mpg|mpeg)$ {
root /var/www/blog;
expires max;
valid_referers blocked ~\.google\.;
if ($invalid_referer) {
rewrite ^(.*)$ http://www.mydomain.com/;
}
}

--
Posted via http://www.ruby-forum.com/.

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

exclude invalid_referrer directory

Todd HG January 01, 2011 11:14PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 89
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready