mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-04-22 23:17:17 +08:00
Base path via environment variable (#17030)
* Base path via environment variable * Feedback refactored * Update docker/main/rootfs/usr/local/nginx/conf/nginx.conf Co-authored-by: Blake Blackshear <blake.blackshear@gmail.com> * Update docker/main/rootfs/usr/local/nginx/templates/base_path.gotmpl Co-authored-by: Blake Blackshear <blake.blackshear@gmail.com> * Revert api regex change * Lint fix * Fix https to http * Base path documentation * Base path contains leading slash * Frigate specific environment variable * Typo in comment Co-authored-by: Blake Blackshear <blake.blackshear@gmail.com> * Typo in comment Co-authored-by: Blake Blackshear <blake.blackshear@gmail.com> --------- Co-authored-by: Blake Blackshear <blake.blackshear@gmail.com>
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
{{ if .base_path }}
|
||||
location = {{ .base_path }} {
|
||||
return 302 {{ .base_path }}/;
|
||||
}
|
||||
|
||||
location ^~ {{ .base_path }}/ {
|
||||
# remove base_url from the path before passing upstream
|
||||
rewrite ^{{ .base_path }}/(.*) /$1 break;
|
||||
|
||||
proxy_pass $scheme://127.0.0.1:8971;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Ingress-Path {{ .base_path }};
|
||||
|
||||
access_log off;
|
||||
}
|
||||
{{ end }}
|
||||
Reference in New Issue
Block a user