I'm using Nginx and GeoIP to block certain countries (to the whole site).
Is it possible to block just one specific directory?
This way:
www.domain.com/
Everyone can access
www.domain.com/ES
Only spanish IP's can access, no one else.
www.domain.com/OTHER
Everyone can access OTHER except China.
(Countries used merely as an example)
Thank you.
And yes, I am aware that GeoIP isn't always accurate, but helps a lot.
Best Answer
Use the
ngx_http_access_module
andngx_http_geo_module
.Source:
http://nginx.org/en/docs/http/ngx_http_access_module.html http://nginx.org/en/docs/http/ngx_http_geo_module.html