1. Caddy version (caddy version
):
devel
# caddy version
(devel)
2. How I run Caddy:
a. System environment:
Proxmox VM < TrueNAS-12.0-U4 < Caddy in a jail iocage
auto-hosted nextcloud instance in a jail
jeedom home automation server on a debian 10 physical machine
b. Command:
service caddy start
c. Service/unit/compose file:
no clue
d. My complete Caddyfile or JSON config:
(logging) {
log {
output file /var/log/caddy/caddy.log {
roll_size 1gb
roll_keep 5
}
}
}
benlem.fr {
import logging
tls lemoalle.benoit@gmail.com
route /jeedom* {
reverse_proxy 192.168.0.XX
}
route /nextcloud* {
reverse_proxy 192.168.0.YY {
header_up Host {host}
header_up X-Forwarded-For {remote}
header_up X-Forwarded-Host {host}
header_up X-Forwarded-Port {server_port}
header_up X-Forwarded-Proto {scheme}
header_up X-Forwarded-Ssl on
header_up X-Real-IP {remote}
header_up X-Url-Scheme {scheme}
}
}
3. The problem I’m having:
my domain name correctly points to my public IP.
Ports 80 and 443 are redirected to the jail Caddy.
When I type “benlem.fr/nextcloud” or “https://benlem.fr/nextcloud” in my browser, I get a blank page. However in the address bar I have the nextcloud home displayed “https://benlem.fr/index.php/apps/dashboard/”
When I type “benlem.fr/jeedom”, I have a 404 error.
4. Error messages and/or full log output:
the log file :
{"level":"info","ts":1625229925.634455,"msg":"using provided configuration","config_file":"/usr/local/etc/caddy/Caddyfile","config_adapter":"caddyfile"}
{"level":"info","ts":1625229925.6418839,"logger":"admin","msg":"admin endpoint
started","address":"tcp/localhost:2019","enforce_origin":false,"origins":["localhost:2019","[::1]:2019","127.0.0.1:2019"]}
{"level":"info","ts":1625229925.6431477,"logger":"tls.cache.maintenance","msg":"started background certificate maintenance","cache":"0xc0002d8000"}
{"level":"info","ts":1625229925.6435986,"logger":"http","msg":"server is listening only on the HTTPS port but has no TLS connection policies; adding one to enable
TLS","server_name":"srv0","https_port":443} {"level":"info","ts":1625229925.6438537,"logger":"http","msg":"enabling automatic HTTP->HTTPS redirects","server_name":"srv0"}
{"level":"info","ts":1625229925.646139,"logger":"http","msg":"enabling automatic TLS certificate management","domains":["benlem.fr"]}
{"level":"info","ts":1625229925.6550736,"logger":"tls","msg":"cleaned up storage units"} {"level":"info","ts":1625229925.670017,"msg":"autosaved
config","file":"/var/db/caddy/config/caddy/autosave.json"} {"level":"info","ts":1625229925.670178,"msg":"serving initial configuration"} Successfully started Caddy (pid=24477) -
Caddy is running in the background {"level":"error","ts":1625229988.38903,"logger":"http.log.access.log0","msg":"handled
request","request":{"remote_addr":"192.168.0.254:53962","proto":"HTTP/2.0","method":"GET","host":"benlem.fr","uri":"/jeedom","headers":{"Te":["trailers"],"User-Agent":["Mozilla/5.0
(X11; Ubuntu; Linux x86_64; rv:89.0) Gecko/20100101
Firefox/89.0"],"Accept":["text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8"],"Accept-Language":["fr,fr-FR;q=0.8,en-US;q=0.5,en;q=0.3"],"Accept-Encoding":["gzip,
deflate, br"],"Cookie":["nc_sameSiteCookielax=true; nc_sameSiteCookiestrict=true; nc_username=ncadmin; nc_token=XXXXXX5hJdL%2BqCOIBu2UEXPP;
nc_session_id=qracvi1hjf6ds92fqevXXXXXX;
oc_sessionPassphrase=rtrpw%2XXXXXXztgnKzpC6MSIjFkl5%2BKhik1u6q757zzVSV%2Fl3UQ7vmOtVKKXKSyuJnwACbLWcdIvOtnNuOT;
ocqyum3fmkdz=qracvi1hjf6ds92fqev6e6aj3p"],"Upgrade-Insecure-Requests":["1"]},"tls":{"resumed":false,"version":772,"cipher_suite":4867,"proto":"h2","proto_mutual":true,"server_name":"benlem>
- - [02/Jul/2021:14:46:28 +0200] \"GET /jeedom HTTP/2.0\" 404 196","duration":0.022765306,"size":196,"status":404,"resp_headers":{"Server":["Caddy","Apache"],"Date":["Fri, 02 Jul
2021 12:46:28 GMT"],"Content-Length":["196"],"Content-Type":["text/html; charset=iso-8859-1"]}}
{"level":"info","ts":1625230030.2267888,"logger":"http.log.access.log0","msg":"handled
request","request":{"remote_addr":"192.168.0.254:53962","proto":"HTTP/2.0","method":"GET","host":"benlem.fr","uri":"/nextcloud","headers":{"User-Agent":["Mozilla/5.0 (X11; Ubuntu;
Linux x86_64; rv:89.0) Gecko/20100101
Firefox/89.0"],"Accept":["text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8"],"Accept-Language":["fr,fr-FR;q=0.8,en-US;q=0.5,en;q=0.3"],"Accept-Encoding":["gzip,
deflate, br"],"Cookie":["nc_sameSiteCookielax=true; nc_sameSiteCookiestrict=true; nc_username=ncadmin; nc_token=OdXXXXXXP;
nc_session_id=qracvi1hjXXXXXXXXXXXXXXX;
oc_sessionPassphrase=rtrpw%2Bm5x5TU3uZeNpbx%2BK6XtZXXXXXXXXXLWcdIvOtnNuOT;
ocqyum3fmkdz=qracvi1hjf6ds92fqev6e6aj3p"],"Upgrade-Insecure-Requests":["1"],"Te":["trailers"]},"tls":{"resumed":false,"version":772,"cipher_suite":4867,"proto":"h2","proto_mutual":true,"se>
- - [02/Jul/2021:14:47:10 +0200] \"GET /nextcloud HTTP/2.0\" 302 0","duration":1.053039821,"size":0,"status":302,"resp_headers":{"Expires":["Thu, 19 Nov 1981 08:52:00
GMT"],"X-Content-Type-Options":["nosniff"],"Content-Security-Policy":["default-src 'self'; script-src 'self'
'nonce-V1A2cjZZZ0d4cnErUjlvb3NGVWRQUi9yOW1WQUZBR3VMcGZoVVZPamovQT06RDdYVDM5RmM5by9QZHI5cDVXMHlUWE9abVRNNVpUamtZYTZIQ1JiUnlKZz0='; style-src 'self' 'unsafe-inline'; frame-src *;
img-src * data: blob:; font-src 'self' data:; media-src *; connect-src *; object-src 'none'; base-uri
'self';"],"Content-Length":["0"],"Pragma":["no-cache"],"Referrer-Policy":["no-referrer"],"X-Frame-Options":["SAMEORIGIN"],"Location":["http://benlem.fr/index.php/apps/dashboard/"],"Date":[>
02 Jul 2021 12:47:09 GMT"],"Cache-Control":["no-store, no-cache, must-revalidate"],"X-Robots-Tag":["none"],"Content-Type":["text/html;
charset=UTF-8"],"X-Download-Options":["noopen"],"X-Permitted-Cross-Domain-Policies":["none"],"X-Xss-Protection":["1;
mode=block"],"X-Powered-By":["PHP/7.4.20"],"Server":["Caddy","Apache/2.4.48 (FreeBSD)"]}} {"level":"info","ts":1625230030.2483644,"logger":"http.log.access.log0","msg":"handled
request","request":{"remote_addr":"192.168.0.254:53962","proto":"HTTP/2.0","method":"GET","host":"benlem.fr","uri":"/index.php/apps/dashboard/","headers":{"Accept":["text/html,application/>
deflate, br"],"Cookie":["nc_sameSiteCookielax=true; nc_sameSiteCookiestrict=true; nc_username=ncadmin; nc_token=OXXXXXPP;
nc_session_id=qracvi1hXXXXXXX;
oc_sessionPassphrase=rtrpw%2Bm5x5TU3uZeNpbx%2BK6XXXXXXXXyuJnwACbLWcdIvOtnNuOT;
ocqyum3fmkdz=qracvi1hjf6ds92fqev6e6aj3p"],"Upgrade-Insecure-Requests":["1"],"Te":["trailers"],"User-Agent":["Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:89.0) Gecko/20100101
Firefox/89.0"]},"tls":{"resumed":false,"version":772,"cipher_suite":4867,"proto":"h2","proto_mutual":true,"server_name":"benlem.fr"}},"common_log":"192.168.0.254 - -
[02/Jul/2021:14:47:10 +0200] \"GET /index.php/apps/dashboard/ HTTP/2.0\" 0 0","duration":0.00017138,"size":0,"status":0,"resp_headers":{"Server":["Caddy"]}}
5. What I already tried:
I’ve been reading posts for 3 days!
I tried on different machines, different browsers, outside and inside my local network …
I modified the caddyfile
benlem.fr {
route /jeedom* {
reverse_proxy 192.168.0.XX
}
route /nextcloud* {
reverse_proxy 192.168.0.YY
}
with or whithout “http://” and “https:://”
tried more simple
benlem.fr
reverse_proxy /nextcloud/* 192.168.0.XX
thanks for your Help!