From 030ac159014b34871776c6d18a947bee2ca4e84a Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Fri, 19 Aug 2022 13:32:51 +0200 Subject: [PATCH] Removed caching from proxy pass and raised fastcgi send and get values to allow Nextcloud to process hugher files. --- .../docker-nextcloud/templates/nginx.conf.j2 | 4 +- .../templates/proxy_pass.conf.j2 | 44 ++----------------- 2 files changed, 5 insertions(+), 43 deletions(-) diff --git a/roles/docker-nextcloud/templates/nginx.conf.j2 b/roles/docker-nextcloud/templates/nginx.conf.j2 index 760e172d..614775ee 100644 --- a/roles/docker-nextcloud/templates/nginx.conf.j2 +++ b/roles/docker-nextcloud/templates/nginx.conf.j2 @@ -23,8 +23,8 @@ http { #tcp_nopush on; keepalive_timeout 65; - fastcgi_send_timeout 600s; - fastcgi_read_timeout 600s; + fastcgi_send_timeout 900s; + fastcgi_read_timeout 900s; proxy_buffering off; #gzip on; diff --git a/roles/native-docker-reverse-proxy/templates/proxy_pass.conf.j2 b/roles/native-docker-reverse-proxy/templates/proxy_pass.conf.j2 index 4e42384c..2ccd96bb 100644 --- a/roles/native-docker-reverse-proxy/templates/proxy_pass.conf.j2 +++ b/roles/native-docker-reverse-proxy/templates/proxy_pass.conf.j2 @@ -18,45 +18,7 @@ location / # timeouts proxy_connect_timeout 1s; - proxy_send_timeout 300s; - proxy_read_timeout 300s; - send_timeout 300s; - - # cache media files - location ~* \.(gif|ico|jpg|jpeg|png|svg|mp4|mp3|pdf)$ { - proxy_buffering on; - proxy_cache cache; - proxy_cache_key $host$uri$is_args$args; - proxy_cache_revalidate on; - proxy_cache_min_uses 1; - proxy_cache_use_stale error timeout updating http_500 http_502 http_503 http_504; - proxy_cache_lock on; - proxy_cache_background_update on; - proxy_cache_valid 200 301 302 365d; - expires 365d; - {% if https_port is defined %} - proxy_pass https://127.0.0.1:{{https_port}}; - {% else %} - proxy_pass http://127.0.0.1:{{http_port}}; - {% endif %} - } - - # cache content - location ~* \.(html|css|js)$ { - proxy_buffering on; - proxy_cache cache; - proxy_cache_key $host$uri$is_args$args; - proxy_cache_revalidate on; - proxy_cache_min_uses 1; - proxy_cache_use_stale error timeout updating http_500 http_502 http_503 http_504; - proxy_cache_lock on; - proxy_cache_background_update on; - proxy_cache_valid 200 301 302 30m; - expires 30m; - {% if https_port is defined %} - proxy_pass https://127.0.0.1:{{https_port}}; - {% else %} - proxy_pass http://127.0.0.1:{{http_port}}; - {% endif %} - } + proxy_send_timeout 900s; + proxy_read_timeout 900s; + send_timeout 900s; }