1. Caddy version (caddy version
):
caddy version
v2.3.0
2. How I run Caddy:
a. System environment:
lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.1 LTS
Release: 20.04
Codename: focal
No docker
b. Command:
paste command here
c. Service/unit/compose file:
cat /etc/systemd/system/caddy.service
[Unit]
Description=Caddy
Documentation=https://caddyserver.com/docs/
After=network.target network-online.target
Requires=network-online.target
[Service]
User=caddy
Group=caddy
ExecStart=/usr/local/bin/caddy run --environ --config /etc/caddy/Caddyfile
ExecReload=/usr/local/bin/caddy reload --config /etc/caddy/Caddyfile
TimeoutStopSec=5s
LimitNOFILE=1048576
LimitNPROC=512
PrivateTmp=true
ProtectSystem=full
AmbientCapabilities=CAP_NET_BIND_SERVICE
[Install]
WantedBy=multi-user.target
d. My complete Caddyfile or JSON config:
testevent.x.de {
log {
output file /home/x/domains/x.de/logs/access.log
format single_field common_log
}
reverse_proxy 172.16.0.101:8002 {
header_up Host {host}
header_up X-Real-IP {remote_host}
header_up X-Forwarded-For {remote_host}
header_up X-Forwarded-Proto {scheme}
# header_up Upgrade {upgrade} (commented out, didn't work either)
# header_up Connection upgrade
# header_up X-Forwarded-Ssl on
}
encode gzip
}
3. The problem I’m having:
Trying to setup “venueless”. It mentions an nginx config, that seems pretty basic. The site itself is loading, but the websocket connection is not working properly.
Image of the errors in my local client console
This is their default config taken from the official documentation:
server {
listen 80 default_server;
listen [::]:80 ipv6only=on default_server;
server_name venueless.mydomain.com;
}
server {
listen 443 default_server;
listen [::]:443 ipv6only=on default_server;
server_name venueless.mydomain.com;
ssl on;
ssl_certificate /path/to/cert.chain.pem;
ssl_certificate_key /path/to/key.pem;
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Forwarded-Ssl on;
proxy_read_timeout 300s;
proxy_redirect http:// https://;
proxy_pass http://localhost:8002;
}
}
4. Error messages and/or full log output:
Getting “socket closed” errors on the client side. Every request/response for the given websocket looks like this:
5. What I already tried:
- Tried to add and remove all kinds of headers
- Tried to catch the /ws/ url and adding all kinds of headers (see the commented sections, these were the headers I was playing with) - no success
6. Links to relevant resources:
https://venueless.readthedocs.io/en/latest/admin/setup.html#id1
Thanks for your time and help!