mirror of
https://github.com/louislam/uptime-kuma.git
synced 2026-03-02 22:57:00 -05:00
cloudflare + nginx + uptime-kuma = wss broken #75
Labels
No labels
A:accessibility
A:api
A:cert-expiry
A:core
A:dashboard
A:deployment
A:documentation
A:domain expiry
A:incidents
A:maintenance
A:metrics
A:monitor
A:notifications
A:reports
A:settings
A:status-page
A:ui/ux
A:user-management
Stale
ai-slop
blocked
blocked-upstream
bug
cannot-reproduce
dependencies
discussion
duplicate
feature-request
feature-request
good first issue
hacktoberfest
help
help wanted
house keeping
invalid
invalid-format
invalid-format
question
releaseblocker 🚨
security
spam
type:enhance-existing
type:new
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/uptime-kuma#75
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @zaanposni on GitHub (Jul 31, 2021).
Hello there,
as the title states my setup looks like this:
Since cloudflare offers some kind of protection I want to ensure everyone that visits my website, connects through cloudflare:
However if I proxy traffic through cloudflare and apply these rules I cannot use kuma.
I am not entirely sure if this is an issue with kuma. However, Cloudflare states that Websockets (with SSL) are 100% supported by them and I have had other applications running with Websockets before.
If I skip cloudflare and allow all connections, kuma works but my SSL certificate is broken, which is kinda ugly.
I am open for suggestions on how to improve my setup since I am not sure if this is an issue with kuma.
Errors I am getting with my configuration:



Response (no content):
nginx
access.logmy nginx config:
@Spiritreader commented on GitHub (Jul 31, 2021):
Hmm that is indeed weird.
Your nginx proxy config looks alright.
I just reverse-proxied my uptime kuma instance using cloudflare, and websockets work fine on my end.
It definitely appears to be an issue with cloudflare, not with uptime kuma.
A few questions:
Can maybe your access rules cause that? Have you tried without them?
Also, which cloudflare settings are you using?
Is the subdomain a CNAME reference?
What's the exact SSl setting (dynamic / strict) etc?
Do you have any of the protection in cloudflare enabled that might block access for this instance?
@louislam commented on GitHub (Aug 1, 2021):
It's OK for me.
https://test-status.louislam.net
Could you try flexible SSL and reverse proxy without self-signed cert?
@zaanposni commented on GitHub (Aug 1, 2021):
Thanks for your suggestions.
I have tried the following things.
DNS:
A status.zaanposni.com -> my ip)CNAME status -> zaanposni.comandA zaanposni.com -> my ip)SSL:
Page rules:
Firewall:
Cloudflares "Access":
Certificate:
I am not sure what you want me to change here. I have a certificate signed by cloudflare which works completly fine. Do websockets handle SSL on a different way?
I have investigated a bit because I thought I had managed to get websockets working for another app already and looked into HedgeDoc.

This is note-taking app I have used for some time and also uses sockets.
HedgeDocs request looks like this
I do not know what the differences between sockets via http and sockets via ws are, but HedgeDoc works with the following
nginx.conf. Maybe you can enable something similiar for kuma?@zaanposni commented on GitHub (Aug 1, 2021):
Ok guys I found the problem. Kinda stupid 😄
Cloudflare Dashboard -> Network -> Enable WebSockets.
I thought they were enabled by default, sorry to waste your time..


For anyone reading in the future: My initial posted config works, no additional stuff required, just be sure to enable WS in Cloudflare 😵.
@louislam commented on GitHub (Aug 1, 2021):
Lol, glad you found the solution. I did not know that too. Will mention it in the wiki too
@Nuckerr commented on GitHub (Sep 20, 2021):
Hi, I'm having this exact same issue, wss is enabled in cloudflare, same error:


I'm using cloudflare ssl certificates & proxying through cloudflare. I'm reverse proxying in nginx, here is my nginx config:
@louislam commented on GitHub (Sep 20, 2021):
Please read wiki, you are missing some headers.
https://github.com/louislam/uptime-kuma/wiki/Reverse-Proxy