1. Output of caddy version
:
v2.5.2 h1:eCJdLyEyAGzuQTa5Mh3gETnYWDClo1LjtQm2q9RNZrs=
2. How I run Caddy:
docker-compose home built dockerfile for caddy-docker-proxy
FROM caddy:builder AS builder
RUN caddy-builder github.com/caddy-dns/cloudflare github.com/lucaslorentz/caddy-docker-proxy/plugin
FROM caddy:2-alpine
COPY --from=builder /usr/bin/caddy /usr/bin/caddy
CMD ["caddy", "docker-proxy"]
caddy-docker-proxy format labels.
labels:
- com.centurylinklabs.watchtower.enable=false
- caddy=*.drogo-internal.andc.nz
- caddy.@nextcloud=host nextcloud.drogo-internal.andc.nz
- caddy.reverse_proxy=@nextcloud "{{ upstreams 80 }}"
Linked to an argo tunnel from https://cloud.andc.nz
With an http host header:
As per what I figured out as part of Caddy (caddy-docker-proxy) returning 0 status - Help - Caddy Community
a. System environment:
Ubuntu LTS 20.04
Client:
Version: 18.06.1-ce
API version: 1.38
Go version: go1.10.3
Git commit: e68fc7a
Built: Tue Aug 21 17:25:03 2018
OS/Arch: linux/amd64
Experimental: true
Server:
Engine:
Version: 18.06.1-ce
API version: 1.38 (minimum version 1.12)
Go version: go1.10.3
Git commit: e68fc7a
Built: Tue Aug 21 17:23:27 2018
OS/Arch: linux/amd64
Experimental: false
b. Command:
n/a docker compose
c. Service/unit/compose file:
services:
caddy:
container_name: caddy
restart: always
mem_limit: 75m
labels:
- com.centurylinklabs.watchtower.enable=false
build:
context: "/hdd/docker-data/network_access/caddy/docker/"
dockerfile: dockerfile
environment:
- ACME_AGREE=true
- LETSENCRYPT_EMAIL=letsencrypt@andc.nz
- CLOUDFLARE_EMAIL=cloudflare@andc.nz
- CLOUDFLARE_API_KEY=${CLOUDFLARE_API_KEY}
- CADDY_INGRESS_NETWORKS=caddy-proxy
- CADDY_DOCKER_CADDYFILE_PATH=/etc/caddy/Caddyfile
networks:
- caddy-proxy
ports:
- 2019:2019
- 443:443
- 8480:8480
- 8443:8443
dns:
- 192.168.10.1
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- "/hdd/docker-data/network_access/caddy/:/etc/caddy/"
- caddy-data:/data
networks:
caddy-proxy:
driver: bridge
external: true
volumes:
caddy-data:
d. My complete Caddy config:
Copy of autosave.conf
{
"admin": {
"listen": "tcp/localhost:2019"
},
"apps": {
"http": {
"servers": {
"srv0": {
"errors": {
"routes": [
{
"handle": [
{
"handler": "subroute",
"routes": [
{
"handle": [
{
"body": "{http.error.status_code} {http.error.status_text}",
"handler": "static_response"
}
]
}
]
}
],
"match": [
{
"host": [
"*.drogo-internal.andc.nz"
]
}
],
"terminal": true
}
]
},
"listen": [
":443"
],
"logs": {},
"routes": [
{
"handle": [
{
"handler": "subroute",
"routes": [
{
"handle": [
{
"error": "Unauthorized",
"handler": "error",
"status_code": 403
}
],
"match": [
{
"path": [
"/*"
]
}
]
}
]
}
],
"match": [
{
"host": [
"drogo-internal.andc.nz"
]
}
],
"terminal": true
},
{
"match": [
{
"host": [
"internal.andc.nz"
]
}
],
"terminal": true
},
{
"handle": [
{
"handler": "subroute",
"routes": [
{
"handle": [
{
"handler": "reverse_proxy",
"upstreams": [
{
"dial": "172.26.0.8:80"
}
]
}
],
"match": [
{
"host": [
"nextcloud.drogo-internal.andc.nz"
]
}
]
},
{
"handle": [
{
"handler": "reverse_proxy",
"upstreams": [
{
"dial": "172.26.0.6:2342"
}
]
}
],
"match": [
{
"host": [
"photos.drogo-internal.andc.nz"
]
}
]
},
{
"handle": [
{
"handler": "reverse_proxy",
"upstreams": [
{
"dial": "172.26.0.7:7878"
}
]
}
],
"match": [
{
"host": [
"radarr.drogo-internal.andc.nz"
]
}
]
},
{
"handle": [
{
"handler": "reverse_proxy",
"upstreams": [
{
"dial": "172.26.0.5:8989"
}
]
}
],
"match": [
{
"host": [
"sonarr.drogo-internal.andc.nz"
]
}
]
},
{
"handle": [
{
"handler": "reverse_proxy",
"upstreams": [
{
"dial": "172.26.0.4:8082"
}
]
}
],
"match": [
{
"host": [
"traccar.drogo-internal.andc.nz"
]
}
]
}
]
}
],
"match": [
{
"host": [
"*.drogo-internal.andc.nz"
]
}
],
"terminal": true
},
{
"handle": [
{
"handler": "subroute",
"routes": [
{
"handle": [
{
"handler": "reverse_proxy",
"upstreams": [
{
"dial": "172.26.0.3:80"
}
]
}
],
"match": [
{
"host": [
"reader.internal.andc.nz"
]
}
]
}
]
}
],
"match": [
{
"host": [
"*.internal.andc.nz"
]
}
],
"terminal": true
}
]
}
}
},
"tls": {
"automation": {
"policies": [
{
"issuers": [
{
"challenges": {
"dns": {
"provider": {
"api_token": "redacted",
"name": "cloudflare"
}
}
},
"email": "letsencrypt@andc.nz",
"module": "acme"
},
{
"challenges": {
"dns": {
"provider": {
"api_token": "redacted",
"name": "cloudflare"
}
}
},
"email": "letsencrypt@andc.nz",
"module": "zerossl"
}
],
"subjects": [
"drogo-internal.andc.nz",
"internal.andc.nz",
"*.drogo-internal.andc.nz",
"*.internal.andc.nz"
]
}
]
}
}
}
}
3. The problem I’m having:
When i navigate to https://cloud.andc.nz I get redirected to https://nextcloud.drogo-internal.andc.nz
It doesn’t affect functionality, but I’d rather not have my internal name exposed.
I added this extra step to the argo, as it works as advertised when I set the internal service to my local http://drogo.andc.nz:8090 - but preferred that argo connected via ssl through caddy, so that tunnel traffic was encrypted.
4. Error messages and/or full log output:
I think these are the relevant log entries
{"level":"info","ts":1662164216.8670776,"logger":"http.log.access","msg":"handled request","request":{"remote_ip":"172.26.0.1","remote_port":"57650","proto":"HTTP/1.1","method":"GET","host":"nextcloud.drogo-internal.andc.nz","uri":"/","headers":{"Cdn-Loop":["cloudflare"],"Cf-Warp-Tag-Id":["d242ff85-d2b1-46d6-98aa-42974293742948"],"Sec-Ch-Ua-Mobile":["?0"],"Sec-Fetch-Site":["none"],"Accept":["text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9"],"Cf-Ray":["744a4cb2082bab05-SYD"],"X-Forwarded-Host":["cloud.andc.nz"],"Dnt":["1"],"Sec-Ch-Ua-Platform":["\"Windows\""],"Sec-Fetch-Dest":["document"],"Sec-Ch-Ua":["\"Chromium\";v=\"104\", \" Not A;Brand\";v=\"99\", \"Microsoft Edge\";v=\"104\""],"User-Agent":["Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.5112.102 Safari/537.36 Edg/104.0.1293.63"],"Accept-Encoding":["gzip"],"Accept-Language":["en-NZ,en;q=0.9"],"Cf-Connecting-Ip":["203.86.195.69"],"Cf-Ipcountry":["NZ"],"Cf-Visitor":["{\"scheme\":\"https\"}"],"Connection":["keep-alive"],"Sec-Fetch-Mode":["navigate"],"Sec-Fetch-User":["?1"],"Upgrade-Insecure-Requests":["1"],"X-Forwarded-For":["203.86.195.69"],"X-Forwarded-Proto":["https"]},"tls":{"resumed":false,"version":772,"cipher_suite":4865,"proto":"","server_name":"nextcloud.drogo-internal.andc.nz"}},"user_id":"","duration":0.06419323,"size":0,"status":302,"resp_headers":{"Location":["https://nextcloud.drogo-internal.andc.nz/login"],"Cache-Control":["no-store, no-cache, must-revalidate"],"Expires":["Thu, 19 Nov 1981 08:52:00 GMT"],"X-Download-Options":["noopen"],"X-Frame-Options":["SAMEORIGIN"],"X-Permitted-Cross-Domain-Policies":["none"],"Referrer-Policy":["no-referrer"],"Date":["Sat, 03 Sep 2022 00:16:56 GMT"],"X-Content-Type-Options":["nosniff"],"X-Robots-Tag":["none"],"Server":["Caddy","nginx/1.18.0"],"Content-Type":["text/html; charset=UTF-8"],"Set-Cookie":[],"X-Xss-Protection":["1; mode=block"],"Pragma":["no-cache"],"Content-Security-Policy":["default-src 'self'; script-src 'self' 'nonce-TDd5RWlZbW1OanpUdWRBdFprei9kSXZ0UFFpZDBqWnh0dE50Z3lBanRQdz06RzR2Ujg5SHVmRnU1ek9COUNuWE5UUE9sVTIydnFFNUI5SkVtckZweWc3ST0='; 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';"]}}
Paste logs/commands/output here.
USE THE PREVIEW PANE TO MAKE SURE IT LOOKS NICELY FORMATTED.
### 5. What I already tried:
<!-- Show us what effort you've put in to solving the problem. Be specific -- people are volunteering their time to help you! Low effort posts are not likely to get good answers! -->
all seems to be related possible to my error correction stuff as mentioned in: [Default error handing - example - subdomain not in added · Issue #396 · lucaslorentz/caddy-docker-proxy (github.com)](https://github.com/lucaslorentz/caddy-docker-proxy/issues/396)
And my other problem.
### 6. Links to relevant resources: