From 4d7e10e5c39262b68a02781941d813412eff0f63 Mon Sep 17 00:00:00 2001 From: th33xitus Date: Sat, 10 Jul 2021 09:22:43 +0200 Subject: [PATCH] script: update nginx configurations --- docs/changelog.md | 3 +++ resources/klipper_webui_nginx.cfg | 16 ++++++++++++++-- resources/upstreams.conf | 20 ++++++++++++++++---- 3 files changed, 33 insertions(+), 6 deletions(-) diff --git a/docs/changelog.md b/docs/changelog.md index f6cdd16..11f5bca 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -2,6 +2,9 @@ This document covers possible important changes to KIAUH. +### 2021-07-10 +* The NGINX configuration files got updated to be in sync with MainsailOS and FluiddPi. Issues with the NGINX service not starting up due to wrong configuration should be resolved now. To get the updated configuration files, please remove Moonraker and Mainsail / Fluidd with KIAUH first and then re-install it. An automated file check for those configuration files might follow in the future which then automates updating those files if there were important changes. + ### 2021-06-29 * KIAUH will now patch the new `log_path` to existing moonraker.conf files when updating Moonraker and the entry is missing. Before that, it was necessary that the user provided that path manually to make Fluidd display the logfiles in its interface. This issue should be resolved now. diff --git a/resources/klipper_webui_nginx.cfg b/resources/klipper_webui_nginx.cfg index 18bc573..24c9abd 100644 --- a/resources/klipper_webui_nginx.cfg +++ b/resources/klipper_webui_nginx.cfg @@ -14,7 +14,7 @@ server { gzip_comp_level 4; gzip_buffers 16 8k; gzip_http_version 1.1; - gzip_types text/plain text/css text/xml text/javascript application/x-javascript application/json application/xml; + gzip_types text/plain text/css text/xml text/javascript application/x-javascript application/json application/xml application/javascript; # web_path from <> static files root /home/pi/<>; @@ -56,6 +56,18 @@ server { } location /webcam/ { - proxy_pass http://mjpgstreamer/; + proxy_pass http://mjpgstreamer1/; + } + + location /webcam2/ { + proxy_pass http://mjpgstreamer2/; + } + + location /webcam3/ { + proxy_pass http://mjpgstreamer3/; + } + + location /webcam4/ { + proxy_pass http://mjpgstreamer4/; } } \ No newline at end of file diff --git a/resources/upstreams.conf b/resources/upstreams.conf index 4ecd9c6..d04e04a 100644 --- a/resources/upstreams.conf +++ b/resources/upstreams.conf @@ -1,13 +1,25 @@ # /etc/nginx/conf.d/upstreams.conf - upstream apiserver { - #edit your api port here ip_hash; server 127.0.0.1:7125; } -upstream mjpgstreamer { - #edit your webcam port here +upstream mjpgstreamer1 { ip_hash; server 127.0.0.1:8080; } + +upstream mjpgstreamer2 { + ip_hash; + server 127.0.0.1:8081; +} + +upstream mjpgstreamer3 { + ip_hash; + server 127.0.0.1:8082; +} + +upstream mjpgstreamer4 { + ip_hash; + server 127.0.0.1:8083; +} \ No newline at end of file