]> Untitled Git - lemmy.git/commitdiff
Adding proxy_cache. #408
authorDessalines <tyhou13@gmx.com>
Sun, 12 Jan 2020 18:28:05 +0000 (13:28 -0500)
committerDessalines <tyhou13@gmx.com>
Sun, 12 Jan 2020 18:28:05 +0000 (13:28 -0500)
ansible/templates/nginx.conf

index 0a420d77797a8ac5e23a6c565e8ad2510546e2f4..1fc6e6746de92a5bce3b12144e975dd6f15d7cb1 100644 (file)
@@ -1,3 +1,5 @@
+proxy_cache_path /var/cache/lemmy_frontend levels=1:2 keys_zone=lemmy_frontend_cache:10m max_size=100m                 use_temp_path=off;
+
 server {
     listen 80;
     server_name {{ domain }};
@@ -59,6 +61,13 @@ server {
         proxy_http_version 1.1;
         proxy_set_header Upgrade $http_upgrade;
         proxy_set_header Connection "upgrade";
+
+        # Proxy Cache
+        proxy_cache             lemmy_frontend_cache;
+        proxy_cache_use_stale   error timeout http_500 http_502 http_503 http_504;
+        proxy_cache_revalidate  on;
+        proxy_cache_lock        on;
+        proxy_cache_min_uses    5;
     }    
 
     location /pictshare/ {