Status
Not open for further replies.
13 comments
What's the point in blocking USA IP's?

If its to stop gov't and media reps from visiting your site there is no point. If they want to get to your site they will just use a proxy. You're blocking a lot of traffic by limiting yourself from USA.

anyways there are programs to convert htaccess to nginx rules
 
I only know FreeBSD's pf can do it.
Install the port net-mgmt/netmask, and use the following command:
Code:
netmask `wget -qO- [URL]http://ftp.apnic.net/stats/apnic/delegated-apnic-latest[/URL] | awk -F'|' '/US\|ipv4/ {print $4":+"($5-1)}' > /etc/US_IP`

Edit the file /etc/pf.conf, and add these lines to appropriate position:
Code:
table <USIP> persist file "/etc/US_IP"
block in quick on $ext_if proto tcp from <USIP> to any port {80,443} label "block US IP"
Don't forget to set $ext_if to your network interface if you haven't used pf so far.

In this example, it only blocks http and https incoming connections; I think it's enough.
I think iptables of Linux has a similar facility, but I don't learn too much about Linux's firewall.
 
oh noes the OP is scared of the FBI they will come to his site thats why he wants to block US ips
NO use man they can use proxies as others said
 
Status
Not open for further replies.
Back
Top