Caddy-maxmind-geolocation reverse_proxy

Hi.
Im tryning to use the plugin.

 Standard modules: 106

http.matchers.maxmind_geolocation

  Non-standard modules: 1

  Unknown modules: 0

I read similar topics but… i cant make it work.

caddy version: 2.7.6

This is my config:

trilium.xxxxxxx.xyz {
  @mygeofilter {
    maxmind_geolocation {
      db_path "/root/GeoLite2_db/GeoLite2-Country.mmdb"
      allow_countries AR
    }
  }

        reverse_proxy @mygeofilter 192.168.0.10:8080

        log {
        output file /var/log/caddy/trilium-access.log {
        roll_size 10mb
        roll_keep 20
        roll_keep_for 720h
  }
}
}

I dont get a file of the log. I dont know if caddy just crash, because i dont get any response in the web browser, and dont see nothing in the log file (i delete it too see the change, and the file is not created. If i delete all the maxmind-geolocation in the config the log file is created and all is working fine)

What i can do?
Thanks

This happen to me a lot… i ask after search and try, search and try… and after post the question i found the solution…:
was the path. It seems that /root… is not a good path. I just change the db to other path /usr/share/Geoip and… is working.

But anyway, i have some problems. Now i cant reach my webs from inside my LAN.
I have in my pcs the /etc/hosts file like this:
192.168.0.3 trilium.xxxxxxxxxx.xyz

but, after this geoip implementation i cant reach the web from inside my LAN. (192.168.0.3 is caddy)
What can i do?

Thanks.

1 Like

Obviously the problem is that the maxmind_geolocation matcher doesn’t consider your LAN IP as coming from that country.

You could use another matcher to allow your private IP ranges with the remote_ip matcher.