summaryrefslogtreecommitdiffstats
path: root/roles/pad-proxy/templates
diff options
context:
space:
mode:
authorOpal <847966@proton.me>2022-10-15 15:27:41 -0700
committerOpal <847966@proton.me>2022-10-15 15:27:41 -0700
commita287e741842f67d0a04c48276221d85f16079d55 (patch)
tree2db596b4ba6709fe10168942bcd0fc5ed2850d02 /roles/pad-proxy/templates
parentd86946ec21f2175d3a5aad58c1ae236291c74b7a (diff)
downloademacsconf-ansible-a287e741842f67d0a04c48276221d85f16079d55.tar.xz
emacsconf-ansible-a287e741842f67d0a04c48276221d85f16079d55.zip
merging code between old emacsconf repo, to sachac's emacsconf repo
Diffstat (limited to 'roles/pad-proxy/templates')
-rw-r--r--roles/pad-proxy/templates/etherpad.nginx.conf33
-rw-r--r--roles/pad-proxy/templates/wikimedia.etherpad.nginx.conf33
2 files changed, 66 insertions, 0 deletions
diff --git a/roles/pad-proxy/templates/etherpad.nginx.conf b/roles/pad-proxy/templates/etherpad.nginx.conf
new file mode 100644
index 0000000..92ba974
--- /dev/null
+++ b/roles/pad-proxy/templates/etherpad.nginx.conf
@@ -0,0 +1,33 @@
+upstream etherpad_upstream {
+ server 127.0.0.1:9001;
+}
+
+server {
+ listen 80;
+ server_name {{ etherpad_server_name }};
+ access_log /var/log/nginx/{{ etherpad_server_name }}.access.log;
+ location ~ ^/(locales/|locales.json|admin/|static/|pluginfw/|javascripts/|socket.io/|ep/|minified/|api/|ro/|error/|jserror/|favicon.ico|robots.txt) {
+ proxy_buffering off;
+ proxy_pass http://etherpad_upstream;
+ }
+ location /p/ {
+ rewrite ^/p/(.*) /$1 redirect;
+ }
+ location ~ ^/$ {
+ proxy_buffering off;
+ proxy_pass http://etherpad_upstream;
+ }
+ location ~ ^/pad-lister($|\/.*) {
+ proxy_buffering off;
+ proxy_pass http://etherpad_upstream;
+ }
+ location / {
+ proxy_set_header Host $host;
+ proxy_set_header X-Real-IP $remote_addr;
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+ proxy_set_header X-Forwarded-Proto $scheme;
+ proxy_pass http://etherpad_upstream/p/;
+ proxy_redirect / /p/;
+ proxy_read_timeout 90;
+ }
+}
diff --git a/roles/pad-proxy/templates/wikimedia.etherpad.nginx.conf b/roles/pad-proxy/templates/wikimedia.etherpad.nginx.conf
new file mode 100644
index 0000000..2288c65
--- /dev/null
+++ b/roles/pad-proxy/templates/wikimedia.etherpad.nginx.conf
@@ -0,0 +1,33 @@
+upstream etherpad_upstream {
+ server 127.0.0.1:9001;
+}
+server {
+ listen 80;
+ server_name {{ etherpad_server_name }};
+ access_log /var/log/nginx/{{ etherpad_server_name }}.access.log;
+ location /p/ {
+ rewrite ^/p/(.*) /$1 redirect;
+ }
+ location ~ ^/$ {
+ return 302 https://etherpad.wikimedia.org/p/emacsconf-2022;
+ }
+ location ~ ^/(locales/|locales.json|admin/|static/|pluginfw/|javascripts/|socket.io/|ep/|minified/|api/|ro/|error/|jserror/|favicon.ico|robots.txt) {
+ proxy_buffering off;
+ proxy_pass http://etherpad_upstream;
+ }
+ location ~ ^/pad-lister($|\/.*) {
+ proxy_buffering off;
+ proxy_pass http://etherpad_upstream;
+ }
+ location /direct/ {
+ rewrite /direct/(.*) /$1 break;
+ proxy_set_header Host $host;
+ proxy_set_header X-Real-IP $remote_addr;
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+ proxy_set_header X-Forwarded-Proto $scheme;
+ proxy_pass http://etherpad_upstream/p/;
+ }
+ location / {
+ rewrite /(.*) https://etherpad.wikimedia.org/p/emacsconf-$1 redirect;
+ }
+}