-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Frigate not redirecting on 302 #20888
Replies: 1 comment · 8 replies
-
|
Frigate's frontend is designed to automatically detect and redirect when a reverse proxy returns a Location header on 401, 302, or 307 unauthorized responses(1). If this is not happening in your setup with Caddy and either caddy-security or Authelia, it suggests that the redirect headers may not be reaching the Frigate frontend as expected, or the proxy setup might be interfering with how responses are delivered to the browser. Key things to check:
If reloading the page triggers the redirect but background requests do not, it could indicate that the frontend JavaScript is not seeing the 302/Location headers on those background requests, possibly due to proxy or browser behavior. For more details on reverse proxy setup and best practices, you may want to review the reverse proxy guide(3). 📚 Sources: Have another question? Just tag @inkeep. |
Beta Was this translation helpful? Give feedback.
All reactions
-
|
You should look at the network tab in the browser to check the headers on the response to ensure the location header is actually there. The browser console would also show any relevant errors. |
Beta Was this translation helpful? Give feedback.
All reactions
-
|
Yes, sorry for the late response. I did check it from the network tab in the developer tools of a browser. Please see below.
|
Beta Was this translation helpful? Give feedback.
All reactions
-
|
Do you see an error message in the console logs? I think the problem may be that Caddy sends a location header that is only the path and not a full url. I think the frontend handler would need to be updated for this type of location header value. |
Beta Was this translation helpful? Give feedback.
All reactions
-
|
I see. I'll pull the console logs this next go around. Some things to note about why caddy may be doing this. In my setup, I have my authentication site at / and frigate at /viewer/. I am assigning the sub folder path per the recommended header X-Ingress-Path = /viewer. |
Beta Was this translation helpful? Give feedback.
All reactions
-
|
The console logs had these errors. Not sure how helpful they are.
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I currently have Frigate setup and functioning with caddy as a reverse proxy and have used both the caddy-security plugin and Authelia for authentication. In both cases (when using either caddy-security or Authelia), when the session times out, Frigate seems to fail to automatically redirect. Instead, what seems to happen is, as the Frigate page requests updated images and/or elements (e.g. cameras) a 302 with a location is returned and the individual cameras fail to load. Over time, all elements of the page fail to load.
Reading the Login page redirection sub section of the Authentication section of the Frigate docs indicate that:
However, this is not the behavior that I am seeing. As soon as the token expires, and the page fails to start loading properly, reloading the page does forward to the back-end authentication page. But, my assumption was that Frigate would automatically redirect as soon as it received a 302 response of any kind and not need interaction from the user.
Maybe I am missing something in my setup?
Beta Was this translation helpful? Give feedback.
All reactions