<div dir="ltr">Hi All,<div><br></div><div>I have a requirement to block certain countries coming to our website.  I managed to achieved it using the ngx_http_geoip_module. I have a problem now, if the request comes through Amazon API Gateway, how can I read the X-forwarded-for header or block these request too.</div><div><br></div><div>nginx.conf</div><div><div>map $geoip_country_code $allow_country {</div><div> default yes; </div><div>SG no; </div><div><div style="color:rgb(34,34,34);font-family:sans-serif;font-size:13px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial"><div>}</div></div><br class="gmail-Apple-interchange-newline"><br></div><div><div>geoip_country /etc/nginx/GeoIP.dat; # the country IP database </div><div>geoip_city /etc/nginx/GeoLiteCity.dat; # the city IP database</div></div><div><br></div><div><br></div></div><div>domain.conf</div><div><div>if ($allow_country = no) { </div><div>return 444; </div><div>}</div><div><br></div><div><div><div dir="ltr" class="gmail_signature">Thanks & Regards<br>Sathish.V</div></div></div></div></div>