77 lines
2.7 KiB
Plaintext
77 lines
2.7 KiB
Plaintext
map $http_upgrade $connection_upgrade {
|
|
default upgrade;
|
|
'' close;
|
|
}
|
|
|
|
server {
|
|
listen 443 ssl http2;
|
|
listen [::]:443 ssl http2;
|
|
server_name etherpad.zinomedia.de;
|
|
|
|
ssl_certificate /etc/letsencrypt/live/etherpad.zinomedia.de/fullchain.pem;
|
|
ssl_certificate_key /etc/letsencrypt/live/etherpad.zinomedia.de/privkey.pem;
|
|
include "snippets/ssl-optimizations.conf";
|
|
|
|
auth_basic "Protected";
|
|
auth_basic_user_file /usr/share/nginx/html/etherpad.zinomedia.de/.htpasswd;
|
|
|
|
resolver 127.0.0.11 valid=30s ipv6=off;
|
|
|
|
location ~ ^/(locales/|locales\.json|admin/|static/|pluginfw/|javascripts/|socket\.io/|ep/|minified/|api/|ro/|error/|jserror|favicon\.ico|robots\.txt|indexBootstrap-.*\.js)$ {
|
|
set $upstream "http://etherpad:9001";
|
|
proxy_pass $upstream;
|
|
proxy_buffering off;
|
|
proxy_http_version 1.1;
|
|
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_set_header X-Forwarded-Host $host;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection $connection_upgrade;
|
|
}
|
|
|
|
location ~ ^/p/(locales/|locales\.json|admin/|static/|pluginfw/|javascripts/|socket\.io/|ep/|minified/|api/|ro/|error/|jserror|favicon\.ico|robots\.txt|indexBootstrap-.*\.js)$ {
|
|
return 301 /$1$is_args$args; # /p/static/... -> /static/...
|
|
}
|
|
|
|
location = / {
|
|
set $upstream "http://etherpad:9001";
|
|
proxy_pass $upstream;
|
|
proxy_buffering off;
|
|
proxy_http_version 1.1;
|
|
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_set_header X-Forwarded-Host $host;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection $connection_upgrade;
|
|
}
|
|
|
|
location ^~ /p/ {
|
|
set $upstream "http://etherpad:9001";
|
|
proxy_pass $upstream;
|
|
proxy_buffering off;
|
|
proxy_http_version 1.1;
|
|
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_set_header X-Forwarded-Host $host;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection $connection_upgrade;
|
|
}
|
|
|
|
location / {
|
|
return 301 /p$uri$is_args$args;
|
|
}
|
|
}
|
|
|
|
server {
|
|
listen 80;
|
|
listen [::]:80;
|
|
server_name etherpad.zinomedia.de;
|
|
return 301 https://$host$request_uri;
|
|
}
|