If you have problems with the Caddy reverse proxy then do it like this.? Edit with your text editor of choice etc/caddy/Caddyfile. Where is says :80 put the IP of your machine followed by the port. Like this 192.168.1.10:7000 Then inside the {where is says delete root * /usr/share/caddy and replace with reverse_proxy IP 192.168.1.10:8080 (your machines IP and the port that kiwix runs) 2 lines down delete file_server.
I recently bought Kiwix and I wanted to see if I can access internet offline. I did not get half of what you are talking about, especially the part where you were coding!
Would be cool to see it work with a Squid_server (both access management and cache) for the Squid is GPLv2, up and that Kiwix is GPLv3. We're talking OpenBSD here. My comment has no hate in it and I do no harm. I am not appalled or afraid, boasting or envying or complaining... Just saying. Psalms23: Giving thanks and praise to the Lord and peace and love. Also, I'd say Matthew6.