From 4654fad4edefc978f6d8e2e0954d214eb767d894 Mon Sep 17 00:00:00 2001 From: Josh Wiles Date: Wed, 1 Jan 2020 08:51:19 -0600 Subject: [PATCH] Add ability to change worker_processes and worker_connections from GUI (#1621) * Add Worker Processes and Worker Connections * Add Worker Processes and Worker Connections * Add Worker Processes and Worker Connections * Tweak help text Co-Authored-By: Fabian Franz BSc * Add minimum value and change version * Remove if/else around worker connections and worker processes Co-authored-by: Fabian Franz BSc --- .../controllers/OPNsense/Nginx/forms/settings.xml | 14 ++++++++++++++ .../mvc/app/models/OPNsense/Nginx/Nginx.xml | 12 +++++++++++- .../service/templates/OPNsense/Nginx/nginx.conf | 4 ++-- 3 files changed, 27 insertions(+), 3 deletions(-) diff --git a/www/nginx/src/opnsense/mvc/app/controllers/OPNsense/Nginx/forms/settings.xml b/www/nginx/src/opnsense/mvc/app/controllers/OPNsense/Nginx/forms/settings.xml index c8bf3cd69..98cbd71d6 100644 --- a/www/nginx/src/opnsense/mvc/app/controllers/OPNsense/Nginx/forms/settings.xml +++ b/www/nginx/src/opnsense/mvc/app/controllers/OPNsense/Nginx/forms/settings.xml @@ -9,6 +9,20 @@ + + nginx.http.workerprocesses + + text + Set the number of worker processes to run. + true + + + nginx.http.workerconnections + + text + Set the maximum connections of each worker. + true + nginx.http.enabled diff --git a/www/nginx/src/opnsense/mvc/app/models/OPNsense/Nginx/Nginx.xml b/www/nginx/src/opnsense/mvc/app/models/OPNsense/Nginx/Nginx.xml index f6ea27be9..08f7f9980 100644 --- a/www/nginx/src/opnsense/mvc/app/models/OPNsense/Nginx/Nginx.xml +++ b/www/nginx/src/opnsense/mvc/app/models/OPNsense/Nginx/Nginx.xml @@ -1,6 +1,6 @@ //OPNsense/Nginx - 1.15.0 + 1.17.0 nginx web server, reverse proxy and waf @@ -18,6 +18,16 @@ + + 1 + 1 + Y + + + 1024 + 1 + Y + 0 N diff --git a/www/nginx/src/opnsense/service/templates/OPNsense/Nginx/nginx.conf b/www/nginx/src/opnsense/service/templates/OPNsense/Nginx/nginx.conf index c9592a5d1..0be1a6a94 100644 --- a/www/nginx/src/opnsense/service/templates/OPNsense/Nginx/nginx.conf +++ b/www/nginx/src/opnsense/service/templates/OPNsense/Nginx/nginx.conf @@ -7,12 +7,12 @@ load_module /usr/local/libexec/nginx/ngx_http_brotli_static_module.so; load_module /usr/local/libexec/nginx/ngx_http_js_module.so; user www staff; -worker_processes 1; +worker_processes {{ OPNsense.Nginx.http.workerprocesses }}; error_log /var/log/nginx/error.log; events { - worker_connections 1024; + worker_connections {{ OPNsense.Nginx.http.workerconnections }}; } http {