Browse Source

first pass at subfilter for ingress support

Blake Blackshear 4 years ago
parent
commit
507ec13848
1 changed files with 8 additions and 2 deletions
  1. 8 2
      nginx/nginx.conf

+ 8 - 2
nginx/nginx.conf

@@ -106,8 +106,14 @@ http {
         }
 
         location / {
-          root /opt/frigate/web;
-          try_files $uri $uri/ /index.html;
+            sub_filter 'href="/' 'href="$http_x_ingress_path/';
+            sub_filter 'url(/' 'url($http_x_ingress_path/';
+            sub_filter '"/js/' '"$http_x_ingress_path/js/';
+            sub_filter '<body>' '<body><script>window.baseUrl="$http_x_ingress_path";</script>';
+            sub_filter_types text/css application/javascript;
+            sub_filter_once off;
+            root /opt/frigate/web;
+            try_files $uri $uri/ /index.html;
         }
     }
 }