1. Caddy version (caddy version
):
v2.3.0 h1:fnrqJLa3G5vfxcxmOH/+kJOcunPLhSBnjgIvjXV/QTA=
2. How I run Caddy:
see docker compose
a. System environment:
Ubuntu 20 lts
Linux hostname 5.4.0-65-generic
b. Command:
docker-compose up -d/restart or caddy restart
c. Service/unit/compose file:
version: "3.7"
services:
caddy:
image: caddy:2
ports:
- "80:80"
- "443:443"
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile
- /home/user/Yotter/app:/var/www/yotter
- /home/user/Yotter/ytproxy:/var/run/ytproxy
restart: unless-stopped
d. My complete Caddyfile or JSON config:
subdomain.domain.tld {
route {
file_server /static/* {
root /var/www/yotter
}
reverse_proxy (/videoplayback/*|/vi/*|/a/*) unix//var/run/ytproxy/http-proxy.sock
reverse_proxy yotter:5000
}
}
3. The problem I’m having:
I’m trying to run Yotter. If I use a simplified version of the caddyfile it works except for the youtube part
subdomain.domain.tld {
reverse_proxy yotter:5000
}
I’m trying to use the suggested nginx configuration to get it working.
server {
listen 80;
server_name <example.com>; # ChangeME
access_log off;
location / {
proxy_pass http://127.0.0.1:5000;
proxy_http_version 1.1;
proxy_set_header Connection "";
}
location /static/ {
root /home/ubuntu/Yotter/app/; # Change this depending on where you clone Yotter
sendfile on;
aio threads=default;
}
location ~ (^/videoplayback$|/videoplayback/|/vi/|/a/) {
proxy_pass http://unix:/var/run/ytproxy/http-proxy.sock;
add_header Access-Control-Allow-Origin *;
sendfile on;
tcp_nopush on;
aio_write on;
aio threads=default;
directio 512;
proxy_http_version 1.1;
proxy_set_header Connection "";
}
}
4. Error messages and/or full log output:
The configuration is accepted by caddy but it does not work ni the browser since all I get is 502
5. What I already tried:
The current Caddyfile configuration is what I came up with. Since I’m getting 502 I suppose they’re getting redirected to the wrong containers/routes. I used route to try and get them in the right order since I read about the priority order “issues”