From 8d23317953991b954c3e8f810d82585a1c227b8d Mon Sep 17 00:00:00 2001 From: root Date: Tue, 15 Nov 2022 07:31:31 -0500 Subject: [PATCH] add etherpad, matrixstatic --- common/etherpad.conf | 11 +++++++++++ common/matrixstatic.conf | 10 ++++++++++ conf.d/etherpad.conf | 31 +++++++++++++++++++++++++++++++ conf.d/matrixstatic.conf | 32 ++++++++++++++++++++++++++++++++ 4 files changed, 84 insertions(+) create mode 100644 common/etherpad.conf create mode 100644 common/matrixstatic.conf create mode 100644 conf.d/etherpad.conf create mode 100644 conf.d/matrixstatic.conf diff --git a/common/etherpad.conf b/common/etherpad.conf new file mode 100644 index 0000000..26e67da --- /dev/null +++ b/common/etherpad.conf @@ -0,0 +1,11 @@ +location / { + proxy_pass http://127.0.0.1:8057; + proxy_buffering off; # be careful, this line doesn't override any proxy_buffering on set in a conf.d/file.conf + proxy_set_header Host $host; + proxy_pass_header Server; + proxy_set_header X-Forwarded-For $remote_addr; # EP logs to show the actual remote IP + proxy_set_header X-Forwarded-Proto $scheme; # for EP to set secure cookie flag when https is used + proxy_http_version 1.1; # recommended with keepalive connections + # WebSocket proxying - from https://nginx.org/en/docs/http/websocket.html + proxy_set_header Upgrade $http_upgrade; +} diff --git a/common/matrixstatic.conf b/common/matrixstatic.conf new file mode 100644 index 0000000..fa4006c --- /dev/null +++ b/common/matrixstatic.conf @@ -0,0 +1,10 @@ +add_header Onion-Location http://mvw.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion$request_uri; +add_header X-I2P-Location http://vernwbp4lxrl7vn5jjgmrdkxnncpfwdzyv57jya2enmw76y4vdha.b32.i2p$request_uri; + +location / { + proxy_pass http://127.0.0.1:8000/; + proxy_redirect off; + proxy_set_header Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; +} diff --git a/conf.d/etherpad.conf b/conf.d/etherpad.conf new file mode 100644 index 0000000..3305f73 --- /dev/null +++ b/conf.d/etherpad.conf @@ -0,0 +1,31 @@ +server { + listen 80; + listen [::]:80; + + server_name ep.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion etherpad.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion; + + include common/etherpad.conf; +} + +server { + listen 11078; + listen [::]:11078; + + server_name vernbm2ykmrqpkhpygk3skotirppddevw3xpkzyyxbcsfqchb27q.b32.i2p; + + include common/etherpad.conf; +} +server { + listen 443 ssl http2; + listen [::]:443 ssl http2; + server_name ep.vern.cc etherpad.vern.cc; + include snippets/lets-encrypt.conf; + include common/etherpad.conf; +} + +server { + listen 80; + listen [::]:80; + return 301 https://$host$request_uri; + server_name ep.vern.cc etherpad.vern.cc; +} diff --git a/conf.d/matrixstatic.conf b/conf.d/matrixstatic.conf new file mode 100644 index 0000000..ddbdc0a --- /dev/null +++ b/conf.d/matrixstatic.conf @@ -0,0 +1,32 @@ +server { + listen 80; + listen [::]:80; + + server_name mvw.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion; + + include common/matrixstatic.conf; +} + +server { + listen 11077; + listen [::]:11077; + + server_name vernwbp4lxrl7vn5jjgmrdkxnncpfwdzyv57jya2enmw76y4vdha.b32.i2p; + + include common/matrixstatic.conf; +} + +server { + listen 443 ssl http2; + listen [::]:443 ssl http2; + server_name mvw.vern.cc; + include snippets/lets-encrypt.conf; + include common/matrixstatic.conf; +} + +server { + listen 80; + listen [::]:80; + return 301 https://$host$request_uri; + server_name mvw.vern.cc; +}