Skip to content

Commit

Permalink
Add caching to fcgi calls for the main website
Browse files Browse the repository at this point in the history
  • Loading branch information
nikdoof committed Aug 15, 2024
1 parent 3de3a8d commit 1bf9028
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions roles/www/files/config/sites/dimension-sh.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
fastcgi_cache_path /var/cache/nginx/dimension-sh levels=1:2 keys_zone=dimension-sh:10m max_size=10m;
fastcgi_cache_methods GET;
fastcgi_cache_key $scheme$request_method$request_uri$fastcgi_script_name;
fastcgi_cache_lock on;
fastcgi_cache_use_stale error timeout invalid_header updating http_500;
fastcgi_cache_valid 5m;
fastcgi_ignore_headers Cache-Control Expires Set-Cookie;

server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
Expand Down Expand Up @@ -54,5 +62,7 @@ server {
fastcgi_pass unix:/var/run/fcgiwrap/fcgiwrap-nginx.sock;
include /etc/nginx/fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_cache dimension-sh;
fastcgi_cache_valid 200 5m;
}
}

0 comments on commit 1bf9028

Please sign in to comment.