Files
configpolicy/roles/frigate-caddy/templates/Caddyfile.j2
Dustin C. Hatch 57c5afc0c8 r/frigate: Fix Authelia redirect
HTTP 301 is "moved permanently." Browsers will cache this response and
never send the request to the real server again.  We need to use a
temporary redirect, such as "see other" to avoid getting stuck in a
login loop.
2025-04-21 08:27:34 -05:00

25 lines
682 B
Django/Jinja

{# vim: set sw=4 ts=4 sts=4 et : #}
{{ frigate_caddy_server_name }} {
{% if frigate_caddy_forward_auth|d %}
forward_auth {{ frigate_caddy_forward_auth.url }} {
uri {{ frigate_caddy_forward_auth.path }}
header_up Host {upstream_hostport}
copy_headers Remote-User
@unauthorized status 401
handle_response @unauthorized {
respond "" 303
header Location {{ frigate_caddy_forward_auth.url}}{{ frigate_caddy_forward_auth.location }}
}
}
{% endif %}
reverse_proxy localhost:8971
{% if frigate_caddy_acme|d %}
tls {{ frigate_caddy_acme.email }} {
ca {{ frigate_caddy_acme.url }}
}
{% endif %}
}