A problem with

Hello everyone, I have a problem with anti leech config

my config file, like this:

    location / {
            valid_referers   none  blocked  bbs.mysite.com 

*.mysite.com;
if ($invalid_referer) {
return 403;
}

It works good, but I have a problem. When I search my site in google,
click
the site url, the browser returns a 403 error. I must press refresh,
then
the site shows.

I think the problem is with anti leech config, so, how can I change the
setting? I just want to protect my images or mp3s.

Thanks very much~

On Sunday 15 June 2008, baalchina wrote:

It works good, but I have a problem. When I search my site in google, click
the site url, the browser returns a 403 error. I must press refresh, then
the site shows.

I think the problem is with anti leech config, so, how can I change the
setting? I just want to protect my images or mp3s.

Thanks very much~

create location for files you want to protect or
add google to valid_referers

You’re protecting your entire site right now.

You want something more specific like this:

        location ~* ^.+\.(jpg|jpeg|gif)$ {
                    valid_referers none blocked foo.com;
                    if ($invalid_referer) {
                            return 403;
                    }
            }

Right now you’re protecting your entire location / :slight_smile: You need to
specify what you want. Remember though that media files like wmv and
such that play using plugins don’t send referrers typically, so the
majority of your protection will be for images and other assets which
properly send a Referer header.

Then programs like Norton Internet Security (puke) have a setting to
block sending referrers, it might be turned on by default. That got me
in the beginning, I had a lot of complaints… so that is why
“blocked” and “none” are good to be in there, due to all the variety
of browsers and “privacy” or “security” programs blocking HTTP
referrer information because the designer thinks that’s a neat
feature…

Yes…I understand…

I’ll try this.
Thank you everyone!

2008/6/16, mike [email protected]: