Compare commits

...

8 Commits

Author SHA1 Message Date
Alexandre
e82f6dc55f Update config.yaml 2026-02-17 17:02:25 +01:00
Alexandre
50e79862d0 Enhance Nginx ingress configuration with rewrites
Updated Nginx configuration to support ingress entry rewrites and added sub_filter directives for various paths.
2026-02-17 17:01:57 +01:00
github-actions
327385053b GitHub bot: changelog 2026-02-17 14:45:10 +00:00
Alexandre
0e0896e6eb Update config.yaml 2026-02-17 15:42:52 +01:00
Alexandre
f87480ca86 Add sub_filter for server path in ingress.conf 2026-02-17 15:41:46 +01:00
github-actions
e35a059a87 GitHub bot: changelog 2026-02-17 10:00:17 +00:00
Alexandre
fb5987bf31 Update config.yaml 2026-02-17 10:58:15 +01:00
Alexandre
e678f59d92 Update 32-ingress.sh 2026-02-17 10:58:04 +01:00
6 changed files with 47 additions and 18 deletions

View File

@@ -118,4 +118,4 @@ slug: birdnet-go
udev: true
url: https://github.com/alexbelgium/hassio-addons/tree/master/birdnet-go
usb: true
version: "nightly-20260113"
version: "nightly-20260118-2"

View File

@@ -4,16 +4,15 @@ server {
include /etc/nginx/includes/proxy_params.conf;
location / {
proxy_pass http://localhost:8080/;
rewrite ^%%ingress_entry%%/(.*)$ /$1 break;
# Proxy pass
proxy_pass http://localhost:8080;
# Disable buffering
# Disable buffering (required for SSE and sub_filter)
proxy_buffering off;
proxy_request_buffering off;
proxy_cache off;
# Next three lines allow websockets
# WebSocket support
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
@@ -22,20 +21,40 @@ server {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
# Tell BirdNET-Go its proxy prefix (NEW — required)
proxy_set_header X-Ingress-Path %%ingress_entry%%;
# Prevent timeouts
proxy_read_timeout 86400;
proxy_send_timeout 86400;
# SSE-specific headers
add_header Cache-Control no-cache;
add_header Content-Type text/event-stream;
# Define date for frontpage
set $today "";
if ($time_iso8601 ~ "^(\d{4}-\d{2}-\d{2})") {
set $today $1;
}
sub_filter 'id="datePicker"' 'id="datePicker" value="$today"';
# sub_filter setup
proxy_set_header Accept-Encoding "";
sub_filter_once off;
sub_filter_types *;
}
# HTML attribute rewrites
sub_filter href=\"/ href=\"%%ingress_entry%%/;
sub_filter src=\"/ src=\"%%ingress_entry%%/;
sub_filter src=\"'/ src=\"'%%ingress_entry%%/;
sub_filter action=\"/ action=\"%%ingress_entry%%/;
# JavaScript string rewrites (needed for Vite dynamic imports)
sub_filter EventSource('/ EventSource('%%ingress_entry%%/;
sub_filter fetch('/ fetch('%%ingress_entry%%/;
# Backtick template literal rewrites
sub_filter `/api/v `%%ingress_entry%%/api/v;
sub_filter "'/api/v" "'%%ingress_entry%%/api/v";
sub_filter \"/api/v \"%%ingress_entry%%/api/v;
sub_filter `/u `%%ingress_entry%%/u;
sub_filter "'/u" "'%%ingress_entry%%/u";
sub_filter \"/u \"%%ingress_entry%%/u;
sub_filter `/asset `%%ingress_entry%%/asset;
sub_filter "'/asset" "'%%ingress_entry%%/asset";
sub_filter \"/asset \"%%ingress_entry%%/asset;
# Streaming/EventSource fix
sub_filter window.location.origin} window.location.origin}%%ingress_entry%%;
}
}

View File

@@ -1,3 +1,7 @@
## 26.2.6-3 (17-02-2026)
- Minor bugs fixed
## 26.2.6-2 (17-02-2026)
- Minor bugs fixed
## 26.2.6 (16-02-2026)
- Minor bugs fixed
## 26.2.4 (04-02-2026)

View File

@@ -50,4 +50,4 @@ slug: netalertx
tmpfs: true
udev: true
url: https://github.com/alexbelgium/hassio-addons
version: "26.2.6"
version: "26.2.6-3"

View File

@@ -11,6 +11,11 @@ declare ingress_port
declare ingress_entry
echo "Adapting for ingress"
# Remove backend api url to use the base path
sed -i "s|'/server'|''|g" /app/back/app.conf
# Adapt nginx configuration
ingress_port=$(bashio::addon.ingress_port)
ingress_interface=$(bashio::addon.ip_address)
ingress_entry=$(bashio::addon.ingress_entry)

View File

@@ -21,6 +21,7 @@ server {
sub_filter '/img/' '%%ingress_entry%%/img/';
sub_filter '/lib/' '%%ingress_entry%%/lib/';
sub_filter '/php/' '%%ingress_entry%%/php/';
sub_filter '"/server' '"%%ingress_entry%%/server';
# Next three lines allow websockets
proxy_http_version 1.1;