fix: harden rewrite websocket configurations for all services
All checks were successful
ci / treefmt (push) Successful in 1m37s
All checks were successful
ci / treefmt (push) Successful in 1m37s
This commit is contained in:
parent
2d2f62fd14
commit
ea516b3f32
2 changed files with 4 additions and 3 deletions
|
|
@ -27,7 +27,7 @@ in {
|
|||
websocket = mkOpt (submodule {
|
||||
options = {
|
||||
enable = mkBoolOpt false "Whether to enable websocket endpoints for the service.";
|
||||
path = mkOpt str "/ws/" "WebSocket path prefix for the service.";
|
||||
path = mkOpt str "/ws" "WebSocket path prefix for the service.";
|
||||
};
|
||||
}) {} "WebSocket configuration for the service.";
|
||||
};
|
||||
|
|
|
|||
|
|
@ -72,8 +72,9 @@
|
|||
|
||||
websocketConfig = optionalString service.websocket.enable ''
|
||||
# --- ${name} (websocket access) ---
|
||||
ProxyPass ${service.websocket.path} ws://${hostIP}:${p}${service.websocket.path} connectiontimeout=30 timeout=300 retry=0
|
||||
ProxyPassReverse ${service.websocket.path} ws://${hostIP}:${p}${service.websocket.path}
|
||||
RewriteCond %{HTTP:Connection} upgrade [NC]
|
||||
RewriteCond %{HTTP:Upgrade} websocket [NC]
|
||||
RewriteRule ^/(.*)$ ws://${hostIP}:${p}${service.websocket.path}/$1 [P,L]
|
||||
|
||||
'';
|
||||
in {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue