From dcb051b1cd57caf14ade731ddf77855f628890a3 Mon Sep 17 00:00:00 2001 From: Livvy Mackintosh Date: Sun, 21 May 2017 01:58:54 +0200 Subject: [PATCH] Add weblate config to nginx.template --- support/nginx/nginx.template | 68 +++++++++++++++++++++++++++++++++++- 1 file changed, 67 insertions(+), 1 deletion(-) diff --git a/support/nginx/nginx.template b/support/nginx/nginx.template index b74b507..f3d23f3 100644 --- a/support/nginx/nginx.template +++ b/support/nginx/nginx.template @@ -35,6 +35,8 @@ server { proxy_set_header X-Forwarded-Proto https; } + client_max_body_size 20M; + } server { @@ -58,5 +60,69 @@ server { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto https; } - + +} + +server { + listen 443 ssl http2; + listen [::]:443 ssl http2; + server_name energy.ojuso.org; + + ssl_certificate /web/certs/energy.ojuso.org/fullchain.pem; + ssl_certificate_key /web/certs/energy.ojuso.org/privkey.pem; + ssl_dhparam /web/certs/dhparam.pem; + ssl_trusted_certificate /web/certs/energy.ojuso.org/chain.pem; + + include directives/*; + + http2_idle_timeout 5m; + + root /web/weblate/data/static; + + gzip on; + gzip_proxied any; + gzip_types text/plain + application/atom+xml + application/rss+xml + application/javascript + text/xml + text/css + application/xml + application/json + image/svg+xml + font/opentype + application/x-font-ttf + application/vnd.ms-fontobject; + + location /favicon.ico { + alias /web/weblate/data/static/favicon.ico; + expires 30d; + add_header Cache-Control "public"; + } + + location /robots.txt { + alias /web/weblate/data/static/robots.txt; + expires 30d; + add_header Cache-Control "public"; + } + + location /static { + alias /web/weblate/data/static/; + expires 30d; + add_header Cache-Control "public"; + } + + location /media { + alias /web/weblate/data/media/; + expires 30d; + add_header Cache-Control "public"; + } + + location / { + proxy_pass http://weblate:8000; + proxy_set_header Host $host; + proxy_set_header X-Forwarded-For $remote_addr; + proxy_set_header X-Forwarded-Proto $scheme; + add_header Cache-Control "no-cache"; + } }