From ca5b164d73458bc8a271838365df5acc948a0acf Mon Sep 17 00:00:00 2001 From: Jan-Henrik Bruhn Date: Fri, 10 Feb 2023 16:41:52 +0100 Subject: [PATCH] nginx experiment --- epaper-station/Dockerfile | 2 +- epaper-station/config.yaml | 2 +- epaper-station/rootfs/etc/nginx/nginx.conf | 11 +++++++++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/epaper-station/Dockerfile b/epaper-station/Dockerfile index 5a20cb5..7977100 100644 --- a/epaper-station/Dockerfile +++ b/epaper-station/Dockerfile @@ -1,7 +1,7 @@ ARG BUILD_FROM=ghcr.io/hassio-addons/base-python/amd64:9.0.1 FROM ${BUILD_FROM} -RUN apk add --no-cache nginx +RUN apk add --no-cache nginx nginx-mod-http-lua ADD "https://github.com/jhbruhn/ZBS_Flasher/archive/refs/heads/rssi_fix.tar.gz" /src.tar.gz RUN mkdir /src && tar xvfz /src.tar.gz -C /src --strip-components=1 diff --git a/epaper-station/config.yaml b/epaper-station/config.yaml index 9093c1a..5269ff2 100644 --- a/epaper-station/config.yaml +++ b/epaper-station/config.yaml @@ -1,6 +1,6 @@ --- name: E-Paper Station -version: 1.0.0.43 +version: 1.0.0.44 #image: ghcr.io/maxwinterstein/homeassistant-addon-toogoodtogo-ha-mqtt-bridge-{arch} slug: epaper-station description: Publish images to E-Paper pricetags diff --git a/epaper-station/rootfs/etc/nginx/nginx.conf b/epaper-station/rootfs/etc/nginx/nginx.conf index 7273e58..9e5e5d7 100644 --- a/epaper-station/rootfs/etc/nginx/nginx.conf +++ b/epaper-station/rootfs/etc/nginx/nginx.conf @@ -1,6 +1,12 @@ +load_module /usr/lib/nginx/modules/ndk_http_module.so; +load_module /usr/lib/nginx/modules/ngx_http_lua_module.so; + +pcre_jit on; + daemon off; error_log /dev/stdout info; + events { } @@ -20,8 +26,9 @@ http { root /public; } - location /input_img { - proxy_pass http://localhost:8080/; + location ^~ /input_img/(?.*) { + set_by_lua $endpath 'return string.lower(ngx.var.endpath)' + proxy_pass http://localhost:8080/$endpath; } location /ws {