opnsense / plugins

OPNsense plugin collection
https://opnsense.org/
BSD 2-Clause "Simplified" License
849 stars 644 forks source link

www/caddy [Feature request]: Ability to bind to selected ip addresses #4355

Open QBANIN opened 1 week ago

QBANIN commented 1 week ago

Important notices Before you add a new report, we ask you kindly to acknowledge the following:

Is your feature request related to a problem? Please describe. I have multi-wan/multi-IP setup but I need caddy to listen only on one or two selected IP address.

Describe the solution you'd like Could be something similar to haproxy implementation.

Describe alternatives you've considered Moving back to HAproxy :)

Additional context obraz

Monviech commented 1 week ago

The current GUI implementation of the os-caddy plugin does not fit your specific use case.

It can be configured as custom configuration file but I do not actively support it. When it breaks it will not be a priority to fix it.

https://docs.opnsense.org/manual/how-tos/caddy.html#bind-caddy-to-interfaces

Most of the time there is no reason to only listen on one WAN interface. Look at the Layer 4 Proxy, you can match and send any kind of traffic and a lot of protocols anywhere you want. This can be configured smartly to get around the issue you might have.

https://docs.opnsense.org/manual/how-tos/caddy.html#caddy-layer4-proxy

Another method is to change the default listening ports of Caddy to e.g. 8080 and 8443 in the GUI and use Port Forward from WAN1 of 80 to localhost:8080 and 443 to localhost:8443.

Duplicate of: https://github.com/opnsense/plugins/issues/4082