OPNsense Forum

English Forums => General Discussion => Topic started by: daveh on March 14, 2025, 05:56:06 PM

Title: Caddy plugin will not start-
Post by: daveh on March 14, 2025, 05:56:06 PM
Hello,
I've been testing caddy to use for a reverse proxy for my web servers. I first test on Opnsense 25.1.1 was able to test and determine it would fit my needs. Since then I have updated to Opnsense 25.1.3 I can no longer keep the Caddy plugin running..

Caddy log shows-
{"level":"info","ts":1741964078.8050168,"msg":"using config from file","file":"/usr/local/etc/caddy/Caddyfile"}
{"level":"warn","ts":1741964078.805278,"msg":"No files matching import glob pattern","pattern":"/usr/local/etc/caddy/caddy.d/*.global"}
{"level":"warn","ts":1741964078.8053687,"msg":"No files matching import glob pattern","pattern":"/usr/local/etc/caddy/caddy.d/*.conf"}
{"level":"info","ts":1741964078.807487,"msg":"adapted config to JSON","adapter":"caddyfile"}
{"level":"info","ts":1741964078.8083298,"msg":"redirected default logger","from":"stderr","to":"unixgram//var/run/caddy/log.sock"}
{"level":"info","ts":1741964078.8096356,"msg":"failed to increase receive buffer size (wanted: 7168 kiB, got 41 kiB). See https://github.com/quic-go/quic-go/wiki/UDP-Buffer-Sizes for details."}
Error: loading initial config: loading new config: http app module: start: listening on :80: listen tcp :80: bind: address already in use
Error: caddy process exited with error: exit status 1

It appears lighttpd is also using port 80??
root@OPNsense:/var/log/caddy # sockstat | grep light
root     lighttpd   42750 7   tcp4   *:8443                *:*
root     lighttpd   42750 8   tcp6   *:8443                *:*
root     lighttpd   42750 9   tcp4   *:80                  *:*
root     lighttpd   42750 10  tcp6   *:80                  *:*
root     lighttpd   42750 11  dgram  -> /var/run/log
root     lighttpd   42750 44  stream -> /tmp/php-fastcgi.socket-0
root     lighttpd   42750 46  stream -> /tmp/php-fastcgi.socket-0
root     lighttpd   42750 47  stream -> /tmp/php-fastcgi.socket-1
root     lighttpd   42750 50  stream -> /tmp/php-fastcgi.socket-0
root     lighttpd   10014 4   tcp4   127.0.0.1:43580       *:*
root     lighttpd   10014 5   dgram  -> /var/run/log

I have the Web GUI configured to use https on port 8443.

Any idea how to make caddy open on the WAN interface or make lighttpd stop opening port 80?

Thanks
Title: Re: Caddy plugin will not start-
Post by: daveh on March 14, 2025, 06:08:27 PM
Nevermind I found the setting to stop lighttpd from using port 80.


After you change the TCP port a Http Redirect is use you can disable the redirect at System: Settings: Administration: Http Redirect check it to disable.
Title: Re: Caddy plugin will not start-
Post by: Monviech (Cedrik) on March 14, 2025, 06:12:46 PM
There is a manual:

https://docs.opnsense.org/manual/how-tos/caddy.html#prepare-opnsense-for-caddy-after-installation