caddy reload --config /usr/local/etc/caddy/Caddyfile
Error: sending configuration to instance: performing request: Post "http://127.0.0.1:2019/load": dial tcp 127.0.0.1:2019: connect: connection refused
> curl -vL 127.0.0.1:80* Trying 127.0.0.1:80...* Immediate connect fail for 127.0.0.1: Connection refused* Failed to connect to 127.0.0.1 port 80 after 0 ms: Could not connect to server* closing connection #0curl: (7) Failed to connect to 127.0.0.1 port 80 after 0 ms: Could not connect to server
sockstat -l | grep -i 80sockstat -l | grep -i 443
# sockstat -l | grep -i 80root lighttpd 30649 4 tcp4 127.0.0.1:43580 *:*root lighttpd 30649 5 tcp6 ::1:43580 *:*root ntpd 10336 23 udp6 fe80::e01d:f0ff:fe2a:e3c2%vtnet0:123 *:*root ntpd 10336 24 udp6 fe80::b8a0:afff:fe98:12fe%vtnet1:123 *:*root ntpd 10336 27 udp6 fe80::1%lo0:123 *:*root php-cgi 38055 0 stream /tmp/php-fastcgi.socket-0root php-cgi 38040 0 stream /tmp/php-fastcgi.socket-0root sshd 11827 8 tcp6 fe80::1%lo0:2223 *:*
service caddy status
service caddy restartservice caddy reload
I can see that Caddy has managed to bind to port 443, but not 80. AFAICT no other service has taken port 80 either: [...]
Thanks -- I ensured that it was still checked.
I could say more if I can see the Caddyfile. But right now no idea really.
{ log { output net unixgram//var/run/caddy/log.sock { } format json { time_format rfc3339 } level DEBUG } servers { protocols h1 h2 h3 } auto_https off grace_period 10s import /usr/local/etc/caddy/caddy.d/*.global}# Reverse Proxy Configuration# Reverse Proxy Domain: "62300f65-2a08-47ef-b1f7-d0e31bbd30c4"*.edholm.cc { tls /var/db/caddy/data/caddy/certificates/temp/64c1e555e19da.pem /var/db/caddy/data/caddy/certificates/temp/64c1e555e19da.key @07356a3a-8362-4a3e-afd3-7f0b521a44e9 { host jelly } handle @07356a3a-8362-4a3e-afd3-7f0b521a44e9 { handle { reverse_proxy 192.168.1.101:8096 { } } }}import /usr/local/etc/caddy/caddy.d/*.conf
Today I took the opportunity to try out Caddy reverse proxy instead of HAproxy, mostly because of a very specific problem with HAproxy...I must say I reverted after trying it thouroughly. My 2cents on this are as follows:
- Caddy is suited to home setups and inexperienced users. HAproxy is much more complex.- For example, the certificate setup is much easier, because you just have to specify the domain and it just works (tm).
- However, if you have more than just one domain, Caddy setup gets a little tedious:* you have to create one domain/certificate plus a http backend for any domain, which includes creating different ones for www.domain.de and domain.de. You cannot combine certificates for multiple domains unless they are subdomains.
* You do not have much control over what type of certificate(s) are created - you cannot specifiy strength or ECC vs. RSA (much less both) and I have not found a means to control if ZeroSSL vs. LetsEncrypt is used.* The ciphers being employed cannot be controlled easily - or, for TLS 1.3, at all. That results in an ssllabs.com score which is suboptimal, becaus 128bit ciphers are allowed. This cannot be changed because of Go limitations.
* You cannot use more than one type of DNS-01 verification if you use wildcard domains.
* The Auto HTTPS feature looks nice first, but indeed it uses a 308 instead of a 301 code, which breaks some monitoring and can only be modified via custom include files.
So, if you just want to reverse-proxy some services in your home network, go with Caddy. For an OpnSense guarding your internet site with several services/domains, stay with HAproxy.
Quote* The Auto HTTPS feature looks nice first, but indeed it uses a 308 instead of a 301 code, which breaks some monitoring and can only be modified via custom include files.-> That sounds like an easy fix if you can tell me what is needed there to change the default if needed.
/usr/local/etc/caddy/caddy.d/redirect.conf: http:// { redir https://{hostport}{uri} 301 }
/usr/local/etc/caddy/caddy.d/redirect.global: auto_https disable_redirects
QuoteSo, if you just want to reverse-proxy some services in your home network, go with Caddy. For an OpnSense guarding your internet site with several services/domains, stay with HAproxy.-> That is a very sane conclusion and I mostly agree with it. Though the way the layer4/7 proxy and matcher ecosystem evolves makes it pretty powerful in its own way, if not only looking at the reverse proxy.
Auto HTTPS is off thats why there is no port 80.Change the setting in general settings.It needs to be on for the automatic http to https redirect even if you dont use lets encrypt.
Select the Auto HTTPS option. "On (default)" creates automatic certificates using "Let's Encrypt" or "ZeroSSL". "Off" turns all automatic certificate requests off.
# curl -vL https://127.0.0.1:443* Trying 127.0.0.1:443...* ALPN: curl offers h2,http/1.1* TLSv1.3 (OUT), TLS handshake, Client hello (1):* TLSv1.3 (IN), TLS alert, internal error (592):* OpenSSL/3.0.15: error:0A000438:SSL routines::tlsv1 alert internal error* closing connection #0curl: (35) OpenSSL/3.0.15: error:0A000438:SSL routines::tlsv1 alert internal error
<15>1 2024-10-28T23:20:18+01:00 OPNsense.edholm.cc caddy - - [meta sequenceId="11"] "debug","ts":"2024-10-28T22:20:18Z","logger":"tls.handshake","msg":"no certificate matching TLS ClientHello","remote_ip":"90.229.225.174","remote_port":"31331","server_name":"edholm.cc","remote":"90.229.225.174:31331","identifier":"edholm.cc","cipher_suites":[4866,4867,4865,49196,49200,159,52393,52392,52394,49195,49199,158,49188,49192,107,49187,49191,103,49162,49172,57,49161,49171,51,157,156,61,60,53,47,255],"cert_cache_fill":0.0001,"load_or_obtain_if_necessary":true,"on_demand":false}<11>1 2024-10-28T23:20:18+01:00 OPNsense.edholm.cc caddy - - [meta sequenceId="12"] "debug","ts":"2024-10-28T22:20:18Z","logger":"http.stdlib","msg":"http: TLS handshake error from 90.229.225.174:31331: no certificate available for 'edholm.cc'"}<15>1 2024-10-28T23:27:38+01:00 OPNsense.edholm.cc caddy - - [meta sequenceId="1"] "debug","ts":"2024-10-28T22:27:38Z","logger":"events","msg":"event","name":"tls_get_certificate","id":"c99f387a-0cb1-4de9-af74-f764659607dd","origin":"tls","data":{"client_hello":{"CipherSuites":[52393,52392,49195,49199,49196,49200,49161,49171,49162,49172,156,157,47,53,49170,10,4867,4865,4866],"ServerName":"","SupportedCurves":[29,23,24,25],"SupportedPoints":"AA==","SignatureSchemes":[2052,1027,2055,2053,2054,1025,1281,1537,1283,1539,513,515],"SupportedProtos":null,"SupportedVersions":[772,771,770,769],"RemoteAddr":{"IP":"45.79.163.72","Port":65403,"Zone":""},"LocalAddr":{"IP":"192.168.1.1","Port":443,"Zone":""}}}}<15>1 2024-10-28T23:27:38+01:00 OPNsense.edholm.cc caddy - - [meta sequenceId="2"] "debug","ts":"2024-10-28T22:27:38Z","logger":"tls.handshake","msg":"no matching certificates and no custom selection logic","identifier":"192.168.1.1"}<15>1 2024-10-28T23:27:38+01:00 OPNsense.edholm.cc caddy - - [meta sequenceId="3"] "debug","ts":"2024-10-28T22:27:38Z","logger":"tls.handshake","msg":"no certificate matching TLS ClientHello","remote_ip":"45.79.163.72","remote_port":"65403","server_name":"","remote":"45.79.163.72:65403","identifier":"192.168.1.1","cipher_suites":[52393,52392,49195,49199,49196,49200,49161,49171,49162,49172,156,157,47,53,49170,10,4867,4865,4866],"cert_cache_fill":0.0001,"load_or_obtain_if_necessary":true,"on_demand":false}<11>1 2024-10-28T23:27:38+01:00 OPNsense.edholm.cc caddy - - [meta sequenceId="4"] "debug","ts":"2024-10-28T22:27:38Z","logger":"http.stdlib","msg":"http: TLS handshake error from 45.79.163.72:65403: no certificate available for '192.168.1.1'"}