mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-11-22 05:23:01 +03:00
fix nginx header inheritance and ws proxy path
Locations that include auth_request.conf declare their own add_header lines, so nginx dropped the server-level nosniff and Referrer-Policy headers on /recordings/, /exports/, /ws, /live/*, and several /api/ routes. auth_request.conf now includes security_headers.conf itself, and the duplicate includes in /vod/, /stream/, /clips/, and /api/ are removed. The /ws proxy_pass no longer carries a trailing slash, so nginx forwards the original path instead of rewriting /ws to /, which closes the path normalization gap gixy flagged.
This commit is contained in:
@@ -22,3 +22,6 @@ add_header Set-Cookie $auth_cookie;
|
||||
## Pass the location header back up if it exists
|
||||
auth_request_set $redirection_url $upstream_http_location;
|
||||
add_header Location $redirection_url;
|
||||
|
||||
## The add_header lines above stop this location inheriting server-level headers
|
||||
include security_headers.conf;
|
||||
|
||||
@@ -152,7 +152,6 @@ http {
|
||||
sub_filter '.m4s' '.m4s$is_args$args';
|
||||
sub_filter '.mp4"' '.mp4$is_args$args"';
|
||||
|
||||
include security_headers.conf;
|
||||
add_header Cache-Control "no-store";
|
||||
expires off;
|
||||
|
||||
@@ -161,7 +160,6 @@ http {
|
||||
|
||||
location /stream/ {
|
||||
include auth_request.conf;
|
||||
include security_headers.conf;
|
||||
add_header Cache-Control "no-store";
|
||||
expires off;
|
||||
|
||||
@@ -185,7 +183,6 @@ http {
|
||||
}
|
||||
|
||||
expires 7d;
|
||||
include security_headers.conf;
|
||||
add_header Cache-Control "public";
|
||||
autoindex on;
|
||||
root /media/frigate;
|
||||
@@ -226,7 +223,7 @@ http {
|
||||
|
||||
location /ws {
|
||||
include auth_request.conf;
|
||||
proxy_pass http://mqtt_ws/;
|
||||
proxy_pass http://mqtt_ws;
|
||||
include proxy.conf;
|
||||
}
|
||||
|
||||
@@ -290,7 +287,6 @@ http {
|
||||
|
||||
location /api/ {
|
||||
include auth_request.conf;
|
||||
include security_headers.conf;
|
||||
add_header Cache-Control "no-store";
|
||||
expires off;
|
||||
proxy_pass http://frigate_api/;
|
||||
|
||||
Reference in New Issue
Block a user