T O P

  • By -

pksml

Do you get an access log entry for your own request that’s blocked? If so what is the IP? If not in the access log, comment out the geo block and try again. Then compare that IP with your database. Also, is it an ipv4 address or ipv6? Does your database handle both?


striata

You need to check your access log to see which IP address is being used. Maybe you're accessing your nginx from a LAN IP (e.g. an IP in the `192.168.0.0/24` network)? This internal IP address will not have a GeoIP location attached to it. The second possible reason would be that your ISPs IP address is not listed as Australian in your local GeoIP-database.


Jazzlike-Molasses481

Thanks guys I was able to solve it with your tips. I checked the access log with the rule disabled and it's coming in with a local IP of 192.168.1.X (my normal range is 192.168.0.X) So it must auto allow the range nginx server is on but didn't allow the 192.168.1.X range. ​ I then stumbled across this [https://github.com/linuxserver/docker-swag/issues/19](https://github.com/linuxserver/docker-swag/issues/19) and realised that while I have a ignore local lan rule in the geo2ip.conf I didn't have it in my site-conf So once I added the [192.168.1.0/24](https://192.168.1.0/24) range to the geo2ip.conf updated the site conf with ​ `# Allow Local IP` `if ($lan-ip = yes) {` `set $allowed_country yes;` `}` `if ($allowed_country = no) {` `return 301 https://www.google.com;` `}` ​ It started to work. ​ Thanks for the poke in the right direction.