[GH-ISSUE #496] 401 when external basic auth enabled with forwarded headers #277

Closed
opened 2026-04-08 16:51:40 +03:00 by zhus · 1 comment
Owner

Originally created by @Lightjohn on GitHub (Dec 10, 2024).
Original GitHub issue: https://github.com/sigoden/dufs/issues/496

First: not sure I would consider that a bug from dufs side at best an unexpected behavior, I will let you judge about it.
Feel free to close.

Problem

I was putting dufs behind traefik and traefik was handling the auth part with basic auth and dufs was behind.
dufs was launched with

dufs /data -A

So everyone is welcome, no user or anything.
Every time I logged successfully with traefik I was getting a 401 from dufs just after that.

Turn out that because traefik was passing the headers from basic auth to dufs, it would not recognize user and was 401, with no log from dufs except the 401.

I was expecting dufs to not check anything as I set nothing on startup command.
Maybe it's a wrong expectation but I would expect to ignore auth header when no auth is configured.

Solved the issue by configuring traefik to not forward headers.

That was my return, mostly on my side.
Have a good day and thanks for this beautiful piece of code :)

Originally created by @Lightjohn on GitHub (Dec 10, 2024). Original GitHub issue: https://github.com/sigoden/dufs/issues/496 First: not sure I would consider that a bug from dufs side at best an unexpected behavior, I will let you judge about it. Feel free to close. **Problem** I was putting dufs behind traefik and traefik was handling the auth part with basic auth and dufs was behind. dufs was launched with `dufs /data -A` So everyone is welcome, no user or anything. Every time I logged successfully with traefik I was getting a 401 from dufs just after that. Turn out that because traefik was passing the headers from basic auth to dufs, it would not recognize user and was 401, with no log from dufs except the 401. I was expecting dufs to not check anything as I set nothing on startup command. Maybe it's a wrong expectation but I would expect to ignore auth header when no auth is configured. Solved the issue by configuring traefik to not forward headers. That was my return, mostly on my side. Have a good day and thanks for this beautiful piece of code :)
zhus closed this issue 2026-04-08 16:51:40 +03:00
Author
Owner

@SolannP commented on GitHub (Dec 10, 2024):

Same with Apache : I had to override the Auth header.
(didn't had the time to submit an issue, thanks!)

<!-- gh-comment-id:2532750849 --> @SolannP commented on GitHub (Dec 10, 2024): Same with Apache : I had to override the Auth header. (didn't had the time to submit an issue, thanks!)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sigoden/dufs#277