From 9b694587b1ed5504360da3172e348f851451ee51 Mon Sep 17 00:00:00 2001 From: Tommy Miland Date: Thu, 14 Apr 2022 12:44:42 +0200 Subject: [PATCH 1/2] Add headless to readme - Added headless to readme. --- README.md | 2 + conf/README.md | 104 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 106 insertions(+) diff --git a/README.md b/README.md index 85f21dc0..fb2d5445 100644 --- a/README.md +++ b/README.md @@ -110,6 +110,8 @@ RM_LOGS=y \ All the default variables are set at the beginning of the script. +For more options, see full [headless config](https://github.com/angristan/nginx-autoinstall/blob/master/conf/README.md#Headless). + ## LICENSE GPL v3.0 diff --git a/conf/README.md b/conf/README.md index 51b7532e..c84635b8 100644 --- a/conf/README.md +++ b/conf/README.md @@ -1,3 +1,107 @@ +## Headless + +- Change `=n` to `=y` to enable modules individually +- Version numbers are configurable +- Custom options in `NGINX_OPTIONS=` + - See [Installation and Compile-Time Options](https://www.nginx.com/resources/wiki/start/topics/tutorials/installoptions/) + - Change between stable and mainline with: + `NGINX_VER=STABLE` or `NGINX_VER=MAINLINE` + - Change between SSL with: + `SYSTEM`, `OPENSSL` or `LIBRESSL` + +- Custom/dynamic modules can be loaded in `NGINX_MODULES=` + - See [NGINX 3rd Party Modules](https://www.nginx.com/resources/wiki/modules/) + - Example: Download to /usr/local/src/nginx-custom-modules + - Load the module with `--add-module=/usr/local/src/nginx-custom-modules/module-name` in `NGINX_MODULES=` like so: + +```shell + NGINX_MODULES="--add-module=/usr/local/src/nginx-custom-modules/module-name" \ +``` +Starting from NGINX 1.9.11, you can also compile modules as a dynamic module: + +```shell + NGINX_MODULES="--add-dynamic-module=/usr/local/src/nginx-custom-modules/module-name" \ +``` + +Then you can explicitly load the module in your `nginx.conf` via the [load_module](http://nginx.org/en/docs/ngx_core_module.html#load_module) directive, for example, + +```shell +load_module /usr/local/src/nginx-custom-modules/module-name_module.so; +``` + +### Full headless config + +```shell +HEADLESS=y \ +NGINX_VER=STABLE \ +PAGESPEED=n \ +BROTLI=n \ +HEADERMOD=n \ +GEOIP=n \ +GEOIP2_ACCOUNT_ID=YOUR_ACCOUNT_ID_HERE \ +GEOIP2_LICENSE_KEY=YOUR_LICENSE_KEY_HERE \ +FANCYINDEX=n \ +CACHEPURGE=n \ +SUBFILTER=n \ +LUA=n \ +WEBDAV=n \ +VTS=n \ +RTMP=n \ +TESTCOOKIE=n \ +HTTP3=n \ +MODSEC=n \ +REDIS2=n \ +HTTPREDIS=n \ +SRCACHE=n \ +SETMISC=n \ +NGXECHO=n \ +HPACK=n \ +SSL=SYSTEM \ +RM_CONF=n \ +RM_LOGS=n \ +NGINX_MAINLINE_VER=1.21.6 \ +NGINX_STABLE_VER=1.20.1 \ +LIBRESSL_VER=3.3.1 \ +OPENSSL_VER=1.1.1l \ +NPS_VER=1.13.35.2 \ +HEADERMOD_VER=0.33 \ +LIBMAXMINDDB_VER=1.4.3 \ +GEOIP2_VER=3.3 \ +LUA_JIT_VER=2.1-20220310 \ +LUA_NGINX_VER=0.10.21rc2 \ +LUA_RESTYCORE_VER=0.1.23rc1 \ +LUA_RESTYLRUCACHE_VER=0.11 \ +NGINX_DEV_KIT=0.3.1 \ +HTTPREDIS_VER=0.3.9 \ +NGXECHO_VER=0.62 \ +NGINX_OPTIONS=" + --prefix=/etc/nginx \ + --sbin-path=/usr/sbin/nginx \ + --conf-path=/etc/nginx/nginx.conf \ + --error-log-path=/var/log/nginx/error.log \ + --http-log-path=/var/log/nginx/access.log \ + --pid-path=/var/run/nginx.pid \ + --lock-path=/var/run/nginx.lock \ + --http-client-body-temp-path=/var/cache/nginx/client_temp \ + --http-proxy-temp-path=/var/cache/nginx/proxy_temp \ + --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp \ + --user=nginx \ + --group=nginx \ + --with-cc-opt=-Wno-deprecated-declarations \ + --with-cc-opt=-Wno-ignored-qualifiers" \ +NGINX_MODULES="--with-threads \ + --with-file-aio \ + --with-http_ssl_module \ + --with-http_v2_module \ + --with-http_mp4_module \ + --with-http_auth_request_module \ + --with-http_slice_module \ + --with-http_stub_status_module \ + --with-http_realip_module \ + --with-http_sub_module" \ +./nginx-autoinstall.sh 2>&1 | tee nginx-installer.log +``` + # Configurations files ## PageSpeed From 02a9453c04e74cb3033d3b1f6ddd48dfc45d0da1 Mon Sep 17 00:00:00 2001 From: tmiland Date: Sat, 16 Apr 2022 12:14:17 +0200 Subject: [PATCH 2/2] Fix linter warnings Fixed linter warnings. --- conf/README.md | 37 +++++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/conf/README.md b/conf/README.md index c84635b8..ad713262 100644 --- a/conf/README.md +++ b/conf/README.md @@ -1,35 +1,40 @@ -## Headless +# Headless - Change `=n` to `=y` to enable modules individually - Version numbers are configurable - Custom options in `NGINX_OPTIONS=` - - See [Installation and Compile-Time Options](https://www.nginx.com/resources/wiki/start/topics/tutorials/installoptions/) - - Change between stable and mainline with: + - See [Installation and Compile-Time Options](https://www.nginx.com/resources/wiki/start/topics/tutorials/installoptions/) + - Change between stable and mainline with: `NGINX_VER=STABLE` or `NGINX_VER=MAINLINE` - - Change between SSL with: + - Change between SSL with: `SYSTEM`, `OPENSSL` or `LIBRESSL` - Custom/dynamic modules can be loaded in `NGINX_MODULES=` - See [NGINX 3rd Party Modules](https://www.nginx.com/resources/wiki/modules/) - Example: Download to /usr/local/src/nginx-custom-modules - - Load the module with `--add-module=/usr/local/src/nginx-custom-modules/module-name` in `NGINX_MODULES=` like so: + - Load the module with `--add-module=/usr/local/src/nginx-custom-modules/module-name` + in `NGINX_MODULES=` like so: ```shell NGINX_MODULES="--add-module=/usr/local/src/nginx-custom-modules/module-name" \ ``` + Starting from NGINX 1.9.11, you can also compile modules as a dynamic module: ```shell - NGINX_MODULES="--add-dynamic-module=/usr/local/src/nginx-custom-modules/module-name" \ + NGINX_MODULES= + "--add-dynamic-module=/usr/local/src/nginx-custom-modules/module-name" \ ``` -Then you can explicitly load the module in your `nginx.conf` via the [load_module](http://nginx.org/en/docs/ngx_core_module.html#load_module) directive, for example, +Then you can explicitly load the module in your `nginx.conf` +via the [load_module](http://nginx.org/en/docs/ngx_core_module.html#load_module) +directive, for example, ```shell load_module /usr/local/src/nginx-custom-modules/module-name_module.so; ``` -### Full headless config +## Full headless config ```shell HEADLESS=y \ @@ -102,9 +107,9 @@ NGINX_MODULES="--with-threads \ ./nginx-autoinstall.sh 2>&1 | tee nginx-installer.log ``` -# Configurations files +## Configurations files -## PageSpeed +### PageSpeed Add this in your http block: @@ -123,7 +128,7 @@ pagespeed FileCachePath /var/ngx_pagespeed_cache; More info here : -## Brotli +### Brotli Add this in your http block : @@ -135,7 +140,7 @@ brotli_comp_level 6; brotli_types *; ``` -## LibreSSL / OpenSSL 1.1+ +### LibreSSL / OpenSSL 1.1+ You can now use ChaCha20 in addition to AES. Add this in your server block: @@ -149,7 +154,7 @@ You can also use more secure curves : ssl_ecdh_curve X25519:P-521:P-384:P-256; ``` -## TLS 1.3 +### TLS 1.3 TLS 1.3 needs special ciphers. @@ -160,11 +165,11 @@ ssl_ciphers TLS-CHACHA20-POLY1305-SHA256:TLS-AES-256-GCM-SHA384:TLS-AES-128-GCM- TLS- can be TLS13-. -## GeoIP 2 +### GeoIP 2 See -## HTTP/3 +### HTTP/3 See @@ -187,7 +192,7 @@ server { } ``` -## Testcookie +### Testcookie Example configuration in nginx.conf: