From c130a1d9a1c224d4edb41ded17a429576050fd75 Mon Sep 17 00:00:00 2001 From: oufmilo <44617467+oufmilo@users.noreply.github.com> Date: Thu, 22 Dec 2022 21:47:27 +0100 Subject: [PATCH] Update nginx.conf --- conf/nginx.conf | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/conf/nginx.conf b/conf/nginx.conf index 565b921..37e57c7 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -23,3 +23,31 @@ location __PATH__/ { # Include SSOWAT user panel. include conf.d/yunohost_panel.conf.inc; } + + # rate limit the login or password reset pages + location ~ ^/(login[^-/]|password-reset|resend-link|2fa-check) { + limit_req zone=loginlimit; + proxy_pass http://127.0.0.1:__PORT__; + } + + location /api/updates/ { + access_log off; + proxy_pass http://127.0.0.1:__PORT__; + } + + # directly serve images and static files from the + # bookwyrm filesystem using sendfile. + # make the logs quieter by not reporting these requests + location ~ ^/(images|static)/ { + root /app; + try_files $uri =404; + add_header X-Cache-Status STATIC; + access_log off; + } + + # monitor the celery queues with flower, no caching enabled + location /flower/ { + proxy_pass http://flower:8888; + proxy_cache_bypass 1; + } +}