nginx geoip module with reverse proxy in multi tenant

blason nginx-forum at
Sat Mar 27 08:09:29 UTC 2021

Hi Team,

This is nginx 1.19.5
I have reverse proxy server where I am hosting around 20 sites behind nginx
reverse proxy server. This reverse proxy server only used for reverse  proxy
purpose and no local web server is running on it.

I need to implement geoip blocking but what I understood from the document
map $geoip_country_code $allowed_country variable to has to be set in http
section and then 
if ($allowed_country = no) {
  return 444;

Can be called in server section. This is fine if I am hosting one site what
if in case of mutiple sites? In this case suppose need to have access blocked from CN
While needs to have access allowed from CN

How do I achieve it?

Posted at Nginx Forum:,291069,291069#msg-291069

More information about the nginx mailing list