From abc02cd06986c21a16e5fac040f3e58cbe7532e4 Mon Sep 17 00:00:00 2001 From: Terry Date: Mon, 5 Aug 2024 23:19:02 +0800 Subject: [PATCH 1/3] Update nginx.conf --- install/etc/nginx/nginx.conf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/install/etc/nginx/nginx.conf b/install/etc/nginx/nginx.conf index 33c5c4f..792af9f 100644 --- a/install/etc/nginx/nginx.conf +++ b/install/etc/nginx/nginx.conf @@ -16,6 +16,8 @@ http { include /etc/nginx/mime.types; default_type application/octet-stream; + resolver 127.0.0.11; + sendfile on; tcp_nopush on; tcp_nodelay on; From 8dd8d6a903403c4f2db6225278cbb90a13d71081 Mon Sep 17 00:00:00 2001 From: Terry Date: Wed, 7 Aug 2024 12:23:07 +0800 Subject: [PATCH 2/3] support NGINX_RESOLVER --- install/assets/defaults/10-nginx | 1 + install/assets/functions/10-nginx | 1 + install/etc/nginx/nginx.conf | 4 ++-- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/install/assets/defaults/10-nginx b/install/assets/defaults/10-nginx index 387ad03..e58468e 100755 --- a/install/assets/defaults/10-nginx +++ b/install/assets/defaults/10-nginx @@ -1,6 +1,7 @@ #!/command/with-contenv bash ENABLE_NGINX=${ENABLE_NGINX:-"TRUE"} +NGINX_RESOLVER=${NGINX_RESOLVER:-"127.0.0.11"} NGINX_AUTHENTICATION_BASIC_PASS=${NGINX_AUTHENTICATION_BASIC_PASS:-password} NGINX_AUTHENTICATION_BASIC_USER=${NGINX_AUTHENTICATION_BASIC_USER:-admin} NGINX_AUTHENTICATION_LDAP_ATTRIBUTE=${NGINX_AUTHENTICATION_LDAP_ATTRIBUTE:-"uid"} diff --git a/install/assets/functions/10-nginx b/install/assets/functions/10-nginx index d6bfd92..15995f1 100755 --- a/install/assets/functions/10-nginx +++ b/install/assets/functions/10-nginx @@ -372,6 +372,7 @@ nginx_configure_mode() { nginx_configure_server() { update_template /etc/nginx/nginx.conf \ + NGINX_RESOLVER \ NGINX_CLIENT_BODY_BUFFER_SIZE \ NGINX_CLIENT_BODY_TIMEOUT \ NGINX_FASTCGI_BUFFERS \ diff --git a/install/etc/nginx/nginx.conf b/install/etc/nginx/nginx.conf index 792af9f..467fbcb 100644 --- a/install/etc/nginx/nginx.conf +++ b/install/etc/nginx/nginx.conf @@ -16,12 +16,12 @@ http { include /etc/nginx/mime.types; default_type application/octet-stream; - resolver 127.0.0.11; - sendfile on; tcp_nopush on; tcp_nodelay on; + resolver {{NGINX_RESOLVER}}; + client_body_timeout {{NGINX_CLIENT_BODY_TIMEOUT}}; send_timeout {{NGINX_SEND_TIMEOUT}}; reset_timedout_connection on; From 11d52f65ea873f69c3c4103d8638fcbf6f700ec6 Mon Sep 17 00:00:00 2001 From: Terry Date: Wed, 7 Aug 2024 12:25:59 +0800 Subject: [PATCH 3/3] update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index f2c25cc..24e836f 100644 --- a/README.md +++ b/README.md @@ -170,6 +170,7 @@ You can choose to request visitors be authenticated before accessing your site. | Parameter | Description | Default | `_FILE` | | ------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------- | ------- | +| `NGINX_RESOLVER` | resolver | `127.0.0.11` | | | `NGINX_AUTHENTICATION_TYPE` | Protect the site with `BASIC`, `LDAP`, `LLNG` | `NONE` | | | `NGINX_AUTHENTICATION_TITLE` | Challenge response when visiting protected site | `Please login` | | | `NGINX_AUTHENTICATION_BASIC_USER1` | If `BASIC` chosen enter this for the username to protect site | `admin` | x |