• Howdy! Welcome to our community of more than 130.000 members devoted to web hosting. This is a great place to get special offers from web hosts and post your own requests or ads. To start posting sign up here. Cheers! /Peo, FreeWebSpace.net
managed wordpress hosting

How to block proxy access to my site?

yaoming

New Member
"advertiser tell me:
How are you? I noticed that a good portion of your traffic is coming from an open proxy computer.

Best regards,"

how to do to block proxy access to my site ?

:confused:
 
edit your .htaccess file

PHP:
order allow,deny
deny from <proxy address 2>
deny from <proxy address 1>
allow from all
 
there is a command or module i don't know exactly called as HTTP_FORWARDED_FOR
this command will show you an ip used behind the proxy :)
so you can set if the HTTP_FORWARDED_FOR is true you can deny it :)
i my self still looking how to enable it under my perl script :)
if you find how to enable it please email me :)

Note : this HTTP_FORWARDED_FOR not work if the proxy is anonym (if i'm right)
 
$HTTP_FORWARDED_FOR is a built-in environment variable that can be used in scripts for example
PHP:
<?php
       $ipToBlock="blah.blah.blah.blah";
       if($HTTP_FORWARDED_FOR==$ipToBlock)
           echo "Sorry you do not have access to view.";
?>
It can be used in perl in a similar manner.
 
does perl really have this $ENV variable? i don't know of any proxy servers (any real ones anyway, not anonymizer or anything) to test out. $ENV{'HTTP_FORWARDED_FOR'} ?
 
does perl really have this $ENV variable? i don't know of any proxy servers (any real ones anyway, not anonymizer or anything) to test out. $ENV{'HTTP_FORWARDED_FOR'} ?
Yes Perl has ,also check if $HTTP_X_FORWARDED_FOR can do some help.
 
I noticed that a good portion of your traffic is coming from an open proxy computer.
usually an "open proxy" = proxy that can be used by everyone. This would be either a public proxy, an anonymizer or a badly configured/trojan infected pc.

In my opinion blocking valid proxies from your site (like an isp's) is a bad move since some people either don't know how to change it and it came preset with their isp install or some ISPs just block all outgoing traffic on port 80 forcing their customers to access the net through a proxy. Others are going to surf from work and those often go through a proxy as well.

Maybe you could mail them back and ask what criteria they use for coming to that conclusion and what they recommend you do about it. Just blocking all proxies regardless of their function is going to cut off a good number of visitors to your site.
 
i had trying to get that env with creating
$ENV{'HTTP_FORWARDED_FOR'} but it's seem cannot work
the cgi cannot read that variable even i had using proxy to trying it :)
 
make a perl script :
------
#!/usr/bin/perl
print "Content-type: text/html\n\n";
print "<html><head><title>Simple CGI program</title></head><body>\n";
for (keys %ENV) {
print "$_ = $ENV{$_}<br>\n";
}
print "</body></html>\n";
------
now choose a proxy and run the script , you can see : HTTP_X_FORWARDED_FOR = xxx.xxx.xxx.xxx
 
anonymizer proxies won't tell you who they're forwarding for... that's kind of the point of having them :)

you might want to check for the HTTP_X_FORWARDED_FOR http header as well.
 
I read this thread fully. But I am wondering. Why do you want to block proxy access to your Website ???
 
Back
Top