"308 - The page isn’t redirecting properly" using Quickstart guide (Caddy behind Cloudflare proxy) #1830

Open
opened 2025-11-20 06:07:35 -05:00 by saavagebueno · 4 comments
Owner

Originally created by @daniellwdb on GitHub (Apr 23, 2025).

Describe the problem

I tried to set up NetBird on my Raspberry Pi in my home network. After it ran successfully, I tried to open the domain logged to the console which results in a permanent redirect loop.

To Reproduce

  • I gave my Raspberry Pi a static IP 192.168.1.145 and set up Port Forwarding in my router:

Image

  • I set up an A record in Cloudflare for my domain pointing to my public IP:

Image

  • I followed the instructions in "using Quick self-hosting with Zitadel IdP" on my Raspberry Pi.
  • I visited the URL generated "You can access the NetBird dashboard at https://netbird.mydomain.dev".

Expected behavior

Page is shown correctly.

Are you using NetBird Cloud?

No.

NetBird version

0.41.3

Is any other VPN software installed?

No.

Debug output

management-1  | Error: failed reading provided config file: /etc/netbird/management.json: failed fetching OIDC configuration from endpoint https://netbird.mydomain.dev/.well-known/openid-configuration Get "https://netbird.mydomain.dev/.well-known/openid-configuration": stopped after 10 redirects

Additional context

Add any other context about the problem here.

Have you tried these troubleshooting steps?

  • Checked for newer NetBird versions
  • Searched for similar issues on GitHub (including closed ones)
  • Restarted the NetBird client
  • Disabled other VPN software
  • Checked firewall settings
Originally created by @daniellwdb on GitHub (Apr 23, 2025). **Describe the problem** I tried to set up NetBird on my Raspberry Pi in my home network. After it ran successfully, I tried to open the domain logged to the console which results in a permanent redirect loop. **To Reproduce** - I gave my Raspberry Pi a static IP `192.168.1.145` and set up Port Forwarding in my router: ![Image](https://github.com/user-attachments/assets/964386b7-838e-4941-a4b6-8bdac9971595) - I set up an A record in Cloudflare for my domain pointing to my public IP: ![Image](https://github.com/user-attachments/assets/996a3c80-cebb-4edb-8fa8-dd487b55de3a) - I followed the instructions in "using Quick self-hosting with Zitadel IdP" on my Raspberry Pi. - I visited the URL generated "You can access the NetBird dashboard at https://netbird.mydomain.dev". **Expected behavior** Page is shown correctly. **Are you using NetBird Cloud?** No. **NetBird version** `0.41.3` **Is any other VPN software installed?** No. **Debug output** ``` management-1 | Error: failed reading provided config file: /etc/netbird/management.json: failed fetching OIDC configuration from endpoint https://netbird.mydomain.dev/.well-known/openid-configuration Get "https://netbird.mydomain.dev/.well-known/openid-configuration": stopped after 10 redirects ``` **Additional context** Add any other context about the problem here. **Have you tried these troubleshooting steps?** - [x] Checked for newer NetBird versions - [x] Searched for similar issues on GitHub (including closed ones) - [x] Restarted the NetBird client - [x] Disabled other VPN software - [x] Checked firewall settings
saavagebueno added the self-hosting label 2025-11-20 06:07:35 -05:00
Author
Owner

@G2G2G2G commented on GitHub (May 5, 2025):

This is the same issue as https://github.com/netbirdio/netbird/issues/2510
they still haven't figured out how to redirect properly or.. the correct method, just stop redirecting.

also https://github.com/netbirdio/netbird/issues/536
also https://github.com/netbirdio/netbird/issues/3525

as far as cloudflare goes you probably can not be proxied and it may work then

here's another one https://github.com/netbirdio/netbird/issues/1742

I notice after reading these that a guy is asking if the issues are still "a problem" in several of the threads.
This issue doesn't go away, people just leave the project and run headscale instead. The default "easy" docker is setup terribly for average DIY selfhosters.
After further reading I see all of your issues would be solved if you follow the headache of a tutorial that is https://docs.netbird.io/selfhosted/selfhosted-guide 80% of the headache is having to do an IDP yourself for these new people, just run it with the netbird. Let them point their reverse proxy at it, open some ports. DONE.

instead there should be an "easy" docker image that just simply runs all of what the current one does but allows you to set a reverse proxy pointing toward it... lol

@G2G2G2G commented on GitHub (May 5, 2025): This is the same issue as https://github.com/netbirdio/netbird/issues/2510 they still haven't figured out how to redirect properly or.. the correct method, just stop redirecting. also https://github.com/netbirdio/netbird/issues/536 also https://github.com/netbirdio/netbird/issues/3525 as far as cloudflare goes you probably can not be proxied and it may work then here's another one https://github.com/netbirdio/netbird/issues/1742 I notice after reading these that a guy is asking if the issues are still "a problem" in several of the threads. This issue doesn't go away, people just leave the project and run headscale instead. The default "easy" docker is setup terribly for average DIY selfhosters. After further reading I see all of your issues would be solved if you follow the headache of a tutorial that is https://docs.netbird.io/selfhosted/selfhosted-guide 80% of the headache is having to do an IDP yourself for these new people, just run it with the netbird. Let them point their reverse proxy at it, open some ports. DONE. instead there should be an "easy" docker image that just simply runs all of what the current one does but allows you to set a reverse proxy pointing toward it... lol
Author
Owner

@nazarewk commented on GitHub (May 12, 2025):

@G2G2G2G I am sorry for your experiences. We are trying to do our best with what we have, as we are not a large corporation with a full, dedicated customer support team. We cannot realistically address all ~900 open issues at once, so we start by simply weeding out the outdated reports that were already fixed in preparation for a proper review by a human and the whole team later on.

With the day-to-day load of help requests, I am only now starting with self-hosted instances myself, and will try to properly support those in the coming months. Please note that there are countless ways to set up both your reverse proxies/identity provider and we cannot dedicate resources to trying them all out.

With the above in mind, I have tried using the quick start self-hosting guide and:

  1. It works flawlessly on a fresh Ubuntu 24.04 EC2 instance with:
    • all ports open
    • just docker, jq & curl installed
    • a single Route 53 entry pointing to the instance
  2. @daniellwdb it indeed results in a 308 redirection loop when paired with Cloudflare

I will spend some time trying to figure something out, but I cannot make any promises.

@nazarewk commented on GitHub (May 12, 2025): @G2G2G2G I am sorry for your experiences. We are trying to do our best with what we have, as we are not a large corporation with a full, dedicated customer support team. We cannot realistically address all ~900 open issues at once, so we start by simply weeding out the outdated reports that were already fixed in preparation for a proper review by a human and the whole team later on. With the day-to-day load of help requests, I am only now starting with self-hosted instances myself, and will try to properly support those in the coming months. Please note that there are countless ways to set up both your reverse proxies/identity provider and we cannot dedicate resources to trying them all out. With the above in mind, I have tried using the quick start self-hosting guide and: 1. It works flawlessly on a fresh Ubuntu 24.04 EC2 instance with: - all ports open - just docker, jq & curl installed - a single Route 53 entry pointing to the instance 2. @daniellwdb it indeed results in a `308` redirection loop when paired with Cloudflare I will spend some time trying to figure something out, but I cannot make any promises.
Author
Owner

@nazarewk commented on GitHub (May 12, 2025):

FYI: after applying this gist (putting SSL in Full mode) it got me to this screen instead:

Image

The redirection loop seems to be a bug/misconfiguration of Caddy combined with Cloudflare, which seems to be quite an old and well-known issue:

You can also work around it by using Cloudflare as DNS instead of reverse proxy (disabling proxy on DNS record).

@nazarewk commented on GitHub (May 12, 2025): FYI: after applying [this gist](https://gist.github.com/lopezjurip/5314252970cc94970058320ac78f490a) (putting SSL in `Full` mode) it got me to this screen instead: ![Image](https://github.com/user-attachments/assets/080ad3c5-8871-4103-aea0-57f48738dc9e) The redirection loop seems to be a bug/misconfiguration of Caddy combined with Cloudflare, which seems to be quite an old and well-known issue: - https://www.reddit.com/r/selfhosted/comments/vbp1my/infinite_https_redirect_with_caddy_cloudflare_and/ You can also work around it by using Cloudflare as DNS instead of reverse proxy (disabling proxy on DNS record).
Author
Owner

@nazarewk commented on GitHub (May 12, 2025):

FYI: it was a one-off error for me with Unauthenticated which I tracked down to empty AUTH_CLIENT_ID= in dashboard.env, so is unrelated.

@daniellwdb could you confirm whether setting SSL to Full resolves your problem and close the issue?

@nazarewk commented on GitHub (May 12, 2025): FYI: it was a one-off error for me with `Unauthenticated` which I tracked down to empty `AUTH_CLIENT_ID=` in `dashboard.env`, so is unrelated. @daniellwdb could you confirm whether setting `SSL` to `Full` resolves your problem and close the issue?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SVI/netbird#1830