From b5148f0dd4731c197c6868d116f8afae38683428 Mon Sep 17 00:00:00 2001 From: vlachosv <40690670+vlachosv@users.noreply.github.com> Date: Tue, 29 Jun 2021 20:10:56 +0300 Subject: [PATCH 1/4] Add Nchan ( https://nchan.io/ ) module option --- nginx-autoinstall.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/nginx-autoinstall.sh b/nginx-autoinstall.sh index 64423e54..3f2c9cfa 100755 --- a/nginx-autoinstall.sh +++ b/nginx-autoinstall.sh @@ -34,6 +34,7 @@ if [[ $HEADLESS == "y" ]]; then WEBDAV=${WEBDAV:-n} VTS=${VTS:-n} RTMP=${RTMP:-n} + NCHAN=${NCHAN:-n} TESTCOOKIE=${TESTCOOKIE:-n} HTTP3=${HTTP3:-n} MODSEC=${MODSEC:-n} @@ -140,6 +141,9 @@ case $OPTION in while [[ $RTMP != "y" && $RTMP != "n" ]]; do read -rp " nginx RTMP [y/n]: " -e -i n RTMP done + while [[ $NCHAN != "y" && $NCHAN != "n" ]]; do + read -rp " nginx NCHAN [y/n]: " -e -i n NCHAN + done while [[ $TESTCOOKIE != "y" && $TESTCOOKIE != "n" ]]; do read -rp " nginx testcookie [y/n]: " -e -i n TESTCOOKIE done @@ -483,6 +487,14 @@ case $OPTION in echo --add-module=/usr/local/src/nginx/modules/nginx-rtmp-module ) fi + + if [[ $NCHAN == 'y' ]]; then + git clone --quiet https://github.com/slact/nchan.git /usr/local/src/nginx/modules/nginx-nchan-module + NGINX_MODULES=$( + echo "$NGINX_MODULES" + echo --add-module=/usr/local/src/nginx/modules/nginx-nchan-module + ) + fi if [[ $TESTCOOKIE == 'y' ]]; then git clone --depth 1 --quiet https://github.com/kyprizel/testcookie-nginx-module.git /usr/local/src/nginx/modules/testcookie-nginx-module From 1b0785f61eba56ccb0c77c3b2c11d8b1f3123dda Mon Sep 17 00:00:00 2001 From: vlachosv <40690670+vlachosv@users.noreply.github.com> Date: Tue, 29 Jun 2021 20:13:47 +0300 Subject: [PATCH 2/4] Remove duplicate headless install option ( RTMP=${RTMP:-n} ) --- nginx-autoinstall.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/nginx-autoinstall.sh b/nginx-autoinstall.sh index 3f2c9cfa..d0b270ab 100755 --- a/nginx-autoinstall.sh +++ b/nginx-autoinstall.sh @@ -39,7 +39,6 @@ if [[ $HEADLESS == "y" ]]; then HTTP3=${HTTP3:-n} MODSEC=${MODSEC:-n} HPACK=${HPACK:-n} - RTMP=${RTMP:-n} SUBFILTER=${SUBFILTER:-n} SSL=${SSL:-1} RM_CONF=${RM_CONF:-y} From 7579e4f3840132a64e8dbd5402154e742f2b166e Mon Sep 17 00:00:00 2001 From: vlachosv <40690670+vlachosv@users.noreply.github.com> Date: Tue, 29 Jun 2021 20:23:39 +0300 Subject: [PATCH 3/4] Add Nchan example configuration for nginx.conf --- conf/README.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/conf/README.md b/conf/README.md index 51b7532e..b6b4335b 100644 --- a/conf/README.md +++ b/conf/README.md @@ -155,3 +155,29 @@ testcookie_redirect_via_refresh off; Which turns off the html part. See + + +## Nchan + +See https://nchan.io/#getting-started + +Example configuration in nginx.conf: + +``` +#... +http { + server { + #... + + location = /sub { + nchan_subscriber; + nchan_channel_id $arg_id; + } + + location = /pub { + nchan_publisher; + nchan_channel_id $arg_id; + } + } +} +``` From c2845a2c0925e83499f66fbea1fbf012a866d253 Mon Sep 17 00:00:00 2001 From: Vaggelis Vlachos <40690670+vlachosv@users.noreply.github.com> Date: Tue, 18 Jan 2022 10:59:37 +0200 Subject: [PATCH 4/4] Add Nchan to README --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 16eb1a57..2b64cb3e 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,7 @@ The script might work on ARM-based architectures, but it's only being regularly - [Cloudflare's patch for HTTP/3](https://blog.cloudflare.com/experiment-with-http-3-using-nginx-and-quiche/) with [Quiche](https://github.com/cloudflare/quiche) and [BoringSSL](https://github.com/google/boringssl). - [Cloudflare's TLS Dynamic Record Resizing patch](https://blog.cloudflare.com/optimizing-tls-over-tcp-to-reduce-latency/) maintained by [nginx-modules](https://github.com/nginx-modules/ngx_http_tls_dyn_size). - [Cloudflare's HTTP/2 HPACK encoding patch](https://blog.cloudflare.com/hpack-the-silent-killer-feature-of-http-2/) ([original patch](https://github.com/cloudflare/sslconfig/blob/master/patches/nginx_1.13.1_http2_hpack.patch), [fixed patch](https://github.com/hakasenyang/openssl-patch/blob/master/nginx_hpack_push_1.15.3.patch)) +- [Nchan](https://github.com/slact/nchan): Nchan - flexible pubsub for the modern web - [ngx_pagespeed](https://github.com/pagespeed/ngx_pagespeed): Google performance module - [ngx_brotli](https://github.com/google/ngx_brotli): Brotli compression algorithm - [ngx_headers_more](https://github.com/openresty/headers-more-nginx-module): Custom HTTP headers