Comments (3)
I haven't used Caddy, but I have it behind nginx (using Linuxserver.io's SWAG container) on my local network for HTTPS (because I embed it in my Home Assistant also using HTTPS). I think maybe I had some websocket issues initially and it was probably a header issue at the proxy (see the proxy.conf
spec below).
Here's my nginx default.conf
, in case it's helpful.
# redirect all traffic to https
server {
listen 80 default_server;
listen [::]:80 default_server;
location / {
return 301 https://$host$request_uri;
}
}
# main server block
server {
listen 443 ssl http2 default_server;
listen [::]:443 ssl http2 default_server;
server_name _;
include /config/nginx/ssl.conf;
client_max_body_size 0;
location /live.html {
return 301 https://$host/;
}
location / {
include /config/nginx/proxy.conf;
include /config/nginx/resolver.conf;
set $upstream_app hamclock;
set $upstream_port 8081;
set $upstream_proto http;
proxy_pass $upstream_proto://$upstream_app:$upstream_port/live.html;
}
}
# API Server
server {
listen 8080 ssl http2 default_server;
server_name _;
include /config/nginx/ssl.conf;
client_max_body_size 0;
location / {
include /config/nginx/proxy.conf;
include /config/nginx/resolver.conf;
set $upstream_app hamclock;
set $upstream_port 8080;
set $upstream_proto http;
proxy_pass $upstream_proto://$upstream_app:$upstream_port;
}
}
And proxy.conf
:
# Timeout if the real server is dead
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503;
# Proxy Connection Settings
proxy_buffers 32 4k;
proxy_connect_timeout 240;
proxy_headers_hash_bucket_size 128;
proxy_headers_hash_max_size 1024;
proxy_http_version 1.1;
proxy_read_timeout 240;
proxy_redirect http:// $scheme://;
proxy_send_timeout 240;
# Proxy Cache and Cookie Settings
proxy_cache_bypass $cookie_session;
#proxy_cookie_path / "/; Secure"; # enable at your own risk, may break certain apps
proxy_no_cache $cookie_session;
# Proxy Header Settings
proxy_set_header Connection $connection_upgrade;
proxy_set_header Early-Data $ssl_early_data;
proxy_set_header Host $host;
proxy_set_header Proxy "";
proxy_set_header Upgrade $http_upgrade;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Method $request_method;
proxy_set_header X-Forwarded-Port $server_port;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-Ssl on;
proxy_set_header X-Forwarded-Uri $request_uri;
proxy_set_header X-Original-Method $request_method;
proxy_set_header X-Original-URL $scheme://$http_host$request_uri;
proxy_set_header X-Real-IP $remote_addr;
resolver.conf
is just:
resolver 127.0.0.11 valid=30s;
from hamclock-docker.
Instead of using Caddy, I switched to Cloudflare's ZeroTrust (how I have most of my Docker containers mapped to DNS). When I look at the container logs, I keep seeing:
LIVE: unknown GET live-ws
If I access it across the LAN, the log shows:
LIVE: client 172.27.0.10: new websocket request
from hamclock-docker.
Take a look at your browser developer tools on the network tab to see what WS requests are going out. Compare the working environment to the non working environment. That might clue you into what the difference is to change your Cloudflare configuration. CF may also have some docs/recommendations for websockets.
from hamclock-docker.
Related Issues (11)
- Support for ARM/v7 (Raspberry Pi)
- Remove `sed` code hack for 3.03 build
- Synology NAS Configuration HOT 26
- Update Docs: HamClock Configuration Notes HOT 3
- Cannot set eastern position for map center HOT 3
- CI: Trigger release +build when HamClock version updates
- Failed to connect to localhost port 8080 after 2ms: container goes into "unhealthy" state HOT 5
- Help with module not found error No module named distutils HOT 2
- attempting to build 32 bit RasPi HOT 4
- v4.04 build failing HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hamclock-docker.