1. Caddy version:
Caddy Version: v2.6.2 h1:wKoFIxpmOJLGl3QXoo6PNbYvGW4xLEgo32GPBEjWL8o=
I am using docker-compose
2. How I installed, and run Caddy:
I installed via docker-compose.
a. System environment:
Ubuntu 20.04.5 LTS, systemd, Dockercat
b. Command:
docker-compose up -d
c. Service/unit/compose file:
version: '3'
services:
caddy:
image: caddy:latest
container_name: caddy
restart: unless-stopped
ports:
- 443:443
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile
- ./site:/srv
- ./caddy_data:/data:rw
- ./caddy_config:/config:rw
reddfeed:
build: Reddfeed
container_name: reddfeed
image: reddfeed:latest
restart: unless-stopped
peertube:
image: chocobozzz/peertube:production-bullseye
container_name: peertube
networks:
default:
ipv4_address: 172.18.0.42
env_file:
- ./Peertube/.env
ports:
- 1935:1935
- 9000:9000
volumes:
- assets:/app/client/dist
- ./Peertube/docker-volume/data:/data
- ./Peertube/docker-volume/config:/config
depends_on:
- postgres
- redis
- postfix
restart: unless-stopped
postgres:
image: postgres:13-alpine
container_name: peertube-postgres
env_file:
- ./Peertube/.env
volumes:
- ./Peertube/docker-volume/db:/var/lib/postgresql/data
restart: unless-stopped
redis:
image: redis:6-alpine
container_name: peertube-redis
volumes:
- ./Peertube/docker-volume/redis:/data
restart: unless-stopped
postfix:
image: mwader/postfix-relay
container_name: peertube-postfix
env_file:
- ./Peertube/.env
volumes:
- ./Peertube/docker-volume/opendkim/keys:/etc/opendkim/keys
restart: unless-stopped
networks:
default:
ipam:
driver: default
config:
- subnet: 172.18.0.0/16
volumes:
assets:
d. My complete Caddy config:
synhang.ddns.net {
tls MYEMAIL@protonmail.com
file_server
reverse_proxy /posts* reddfeed:5000{uri}
reverse_proxy /sub/* reddfeed:5000{uri}
reverse_proxy /watch* peertube:9000
}
3. The problem I’m having:
My intention is to have ‘/’ go to a static webpage (which it does fine). If a user types this location: https:// synhang. ddns .net/posts it should reverse_proxy to the reddfeed container which is a flask app listening on 0.0.0.0:5000. If the user types the /sub/ URI they need an additional section behind it like so: https://synhang.ddns.net/sub/arduino. Finally, if a user types this URI: https:// synhang .ddns .net/watch it should redirect to my peertube instance which is listening on port 9000.
4. Error messages and/or full log output:
5. What I already tried:
When loading the local IP in a browser to access the resources directly. I.e. http://192.168.0.23:5000/posts or http://192.168.0.23:5000/sub/arduino I can access the resources just fine. Likewise if I load http://192.168.0.23:9000 I get the peertube instance. But if I try to access it via the domain. I get these errors:
For the :5000 URIs I get a 502 bad gateway error. And for the /watch endpoint I get
Loading module from “https://synhang.ddns.net/client/en-US/runtime.ce410da37895951f.js” was blocked because of a disallowed MIME type (“”).
and errors such as:
GET https://synhang.ddns.net/client/en-US/styles.89b7ff258a4af6c2.css
Which is a 404
There are many such errors
I know with Nginx I can have and include mime.types; directive to catch most mimes but how do I do this with caddy.
But the 502 and 404 errors are not occurring when running from within the LAN