From 03840abca4b8719e6af3c96593f0148909b053b1 Mon Sep 17 00:00:00 2001 From: Dennis Gunia Date: Sun, 19 Oct 2025 19:51:30 +0200 Subject: [PATCH] Added webserver --- software/pc_client/nginx/nginx.conf | 44 +++++++++++++++++++ software/pc_client/nginx/run.sh | 12 +++++ .../nginx/www}/web_gui/css/pico.min.css | 0 .../nginx/www}/web_gui/index.html | 0 .../nginx/www}/web_gui/js/sfc.js | 0 5 files changed, 56 insertions(+) create mode 100644 software/pc_client/nginx/nginx.conf create mode 100755 software/pc_client/nginx/run.sh rename software/{ => pc_client/nginx/www}/web_gui/css/pico.min.css (100%) rename software/{ => pc_client/nginx/www}/web_gui/index.html (100%) rename software/{ => pc_client/nginx/www}/web_gui/js/sfc.js (100%) diff --git a/software/pc_client/nginx/nginx.conf b/software/pc_client/nginx/nginx.conf new file mode 100644 index 0000000..afef2c0 --- /dev/null +++ b/software/pc_client/nginx/nginx.conf @@ -0,0 +1,44 @@ +events {} +http { + + ## + # Basic Settings + ## + + sendfile on; + tcp_nopush on; + types_hash_max_size 2048; + + include /etc/nginx/mime.types; + default_type application/octet-stream; + + gzip on; + + map $http_upgrade $connection_upgrade { + default upgrade; + '' close; + } + + server { + listen 8087 default_server; + listen [::]:8087 default_server; + + + root /nas_projects/current/SplitFlapController/software/pc_client/nginx/www/web_gui; + + # Add index.php to the list if you are using PHP + index index.html index.htm index.nginx-debian.html; + + location /manage/ { + proxy_pass http://localhost:8089; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection $connection_upgrade; + proxy_connect_timeout 7d; + proxy_send_timeout 7d; + proxy_read_timeout 7d; + } + } + + +} diff --git a/software/pc_client/nginx/run.sh b/software/pc_client/nginx/run.sh new file mode 100755 index 0000000..742d690 --- /dev/null +++ b/software/pc_client/nginx/run.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +# This file is part of SplitFlapController project. +# Copyright (C) 2024-2025 GuniaLabs (www.dennisgunia.de) +# Author: Dennis Gunia +# +# This program is licensed under the AGPLv3 license. You can find a copy +# of the license in the LICENSE file in the root directory of this +# project. + +# Run the nginx server with the specified configuration file in background +sudo nginx -c $(pwd)/nginx.conf \ No newline at end of file diff --git a/software/web_gui/css/pico.min.css b/software/pc_client/nginx/www/web_gui/css/pico.min.css similarity index 100% rename from software/web_gui/css/pico.min.css rename to software/pc_client/nginx/www/web_gui/css/pico.min.css diff --git a/software/web_gui/index.html b/software/pc_client/nginx/www/web_gui/index.html similarity index 100% rename from software/web_gui/index.html rename to software/pc_client/nginx/www/web_gui/index.html diff --git a/software/web_gui/js/sfc.js b/software/pc_client/nginx/www/web_gui/js/sfc.js similarity index 100% rename from software/web_gui/js/sfc.js rename to software/pc_client/nginx/www/web_gui/js/sfc.js