So I recently started getting issues with NGINX crashing for unknown reasons.
After passing to much time on trying to fix it I decided to move to Caddy instead.
My caddy configuration works for navigating the website, but it breaks the /synchrony
access, used when editing the pages. The pure websocket part works, I tested using http://websocket.org/echo.html, but Confluence also retrieves some scripts through that path.
I used the following as reference for troobleshooting: https://confluence.atlassian.com/conf60/troubleshooting-collaborative-editing-852732552.html
My working NGINX configuration
server {
listen 443 ssl;
server_name [REDACTED];
ssl_certificate [REDACTED];
ssl_certificate_key [REDACTED];
client_max_body_size 100m;
location / {
proxy_pass http://localhost:8090;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /synchrony {
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://localhost:8091/synchrony;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
}
}
My suggested equivalent non-working Caddy configuration
https://[REDACTED] {
log access.log
errors error.log
gzip
tls "C:\caddy\[REDACTED].cer" "C:\caddy\[REDACTED].key"
proxy /synchrony http://localhost:8091/synchrony {
websocket
}
proxy / http://localhost:8090 {
except /synchrony
transparent
}
}
The above is based on the following documentation: https://caddyserver.com/docs/proxy
It uses the transparent
& websocket
presets.