OPNsense Forum

English Forums => 25.7, 25.10 Series => Topic started by: erbmur on November 03, 2025, 01:13:30 PM

Title: Help needed with Caddy settings
Post by: erbmur on November 03, 2025, 01:13:30 PM
Hi All,

Im trying to setup caddy and am hitting a roadblock.
I need to setup some handers for a domain that is freely accessible from the local network, but must pass through an auth provider when being accessed externally.
I have setup the two handlers for the domain, the first one is access list locked, the second has the authenticator pass ticked.
However, when checking the automatically generated config, I can see that an automatic abort handlers has been placed into the first handler instance for my internal network, so the second external handler never receives any traffic.
Is there a way of turning this off?  Or is there a workaround that I need to do?
Title: Re: Help needed with Caddy settings
Post by: Monviech (Cedrik) on November 03, 2025, 01:22:28 PM
The abort should only be generated in the scope of the handler if you attach an access list to it. Which means, if you have two handlers that match exactly the same path, the first configured one wins always.

What you want to do is not possible in the GUI, you cannot have any complex matching like this. If it should be freely accessable from the local network, configure your auth provider to read the client's IP address from the header (e.g. X-Forwarded-For) and auto log them in if they have RFC1918 addresses or something.
Title: Re: Help needed with Caddy settings
Post by: erbmur on November 03, 2025, 01:27:42 PM
OK,
thanks for the advice!