Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add headless to readme #237

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
125 changes: 117 additions & 8 deletions conf/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,115 @@
# Configurations files
# 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
### PageSpeed

Add this in your http block:

Expand All @@ -19,7 +128,7 @@ pagespeed FileCachePath /var/ngx_pagespeed_cache;

More info here : <https://angristan.fr/compiler-installer-nginx-module-pagespeed-debian/>

## Brotli
### Brotli

Add this in your http block :

Expand All @@ -31,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:

Expand All @@ -45,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.

Expand All @@ -56,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 <https://github.com/leev/ngx_http_geoip2_module#example-usage>

## HTTP/3
### HTTP/3

See <https://github.com/cloudflare/quiche/tree/master/extras/nginx#readme>

Expand All @@ -83,7 +192,7 @@ server {
}
```

## Testcookie
### Testcookie

Example configuration in nginx.conf:

Expand Down