简体   繁体   中英

How to limit an Apache server to only accept HTTP request from a city OR state in USA?

How to limit an Apache server to only accept HTTP request from a city OR state in USA?

I have access to the httpd.conf file.

That information is not transmitted on an http header. Plus if it could the proxy would ruin all that info. This is how countries in general fail to keep certain traffic out. It's easier to establish which traffic is allowed.

You would need to install a GeoIP module such as mod_geoip2 .

Note that GeoIP data is not, in general, reliable—especially down to a fine-grained town level. If you choose to whitelist access based on city you will certainly block access to a significant number of people in the city, and all mobile users.

This is typically a really bad idea.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM