Open zylxpl opened 1 month ago
What kind of a redirect+method are you using? https://developer.mozilla.org/en-US/docs/Web/HTTP/Redirections
In my case all of them are 302 Found redirections:
< HTTP/2 302
< alt-svc: h3=":443"; ma=2592000
< content-type: text/html; charset=utf-8
< date: Tue, 30 Jul 2024 22:17:06 GMT
< location: /graph
< content-length: 29
π I have found these related issues/pull requests
NA
π‘οΈ Security Policy
Description
I am trying to monitor several services behind a Traefik reverse proxy using Uptime Kuma. Both Traefik and Uptime Kuma are on the same Docker network, and I am using Docker's DNS resolution to connect to the Traefik container by specifying its Docker DNS name (https://traefik/) in the URL field.
To ensure Traefik correctly handles requests to specific services, I am setting the HTTP header Host with the appropriate domain (e.g., whoami.example.com). Traefik also requires the correct Server Name Indication (SNI) or a matching domain to respond with the correct certificate. This setup works for most services. However, I encounter an issue with services that respond with a redirect. For these services, Uptime Kuma returns a 526 error code.
When manually checking these services, they work as expected. Additionally, if I specify the final path after redirects in the URL, it works correctly. This leads me to believe that Uptime Kuma might not be handling HTTP headers properly during redirects.
π Reproduction steps
Set Up Docker Network:
Ensure that both Traefik and Uptime Kuma are on the same Docker network.
Configure Traefik:
Set up Traefik with services that include redirects, e.g. Prometheus Ensure Traefik is configured to handle ssl requests.
Set Up Uptime Kuma:
Deploy Uptime Kuma on the same Docker network. Add a new monitor in Uptime Kuma. In the URL field, specify the Docker DNS name of the Traefik container (e.g., https://traefik).
Set HTTP Header in Uptime Kuma:
Set the HTTP header Host to the appropriate domain for the service (e.g., prometheus.example.com).
Test Service with Redirects:
Ensure the service behind Traefik responds with a redirect. Observe that Uptime Kuma returns a 526 error code.
Manual Check:
Manually access the service URL with the same Host header and note that it works correctly. Specify the final path after redirects in Uptime Kuma's URL field (e.g. /graph) and observe that it works correctly.
π Expected behavior
π Actual Behavior
π» Uptime-Kuma Version
1.23.13
π» Operating System and Arch
Ubuntu 20.04 aarch64
π Browser
Firefox
π₯οΈ Deployment Environment
π Relevant log output
No response