Allow ip from local LAN
Hi. Im using this kind of config in my Caddyfile:
test.example.org {
@mygeofilter {
maxmind_geolocation {
db_path "/usr/share/GeoIP/GeoLite2-Country.mmdb"
allow_countries IT FR
}
}
file_server @mygeofilter {
root /var/www/html
}
}
And all is working fine except that i cant reach my webs from y local LAN. in my PC i have this to point from inside my network /etc/hosts 192.168.0.3 trilium.xxxxxxx.xyz
(192.168.0.3 is caddy) What can i do? Thanks
I assume that your Caddy instance is running on your LAN. In that case, I would rather suggest you remove that entry from your hosts file and enter the FQDN to access your website. That is because you will probably have set up automatic HTTPS and I don't think you have added your local LAN IP address into your website's certificate's SAN (domain names that the certificate can authenticate). Therefore, that might be one of the reasons your website is currently not working.
you can either use "allow_countries UNK IT FR" so it will allow IP from unknown countries, including LAN IP or use deny_countries XX XY YY to block countries
There is a way to do this using Caddy syntax, detailed here: https://github.com/porech/caddy-maxmind-geolocation/issues/11