Skip to content

Commit

Permalink
[deploy] improve caching on nginx
Browse files Browse the repository at this point in the history
  • Loading branch information
avkhozov committed Aug 24, 2023
1 parent 54360ad commit 7810961
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion ansible/roles/web/templates/cs.nginx.conf.j2
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
proxy_cache_path /var/cache/nginx/cs keys_zone=cs:10m max_size=512m inactive=300s;
proxy_cache_path /var/cache/nginx/cs_flag_ids keys_zone=cs_flag_ids:10m max_size=512m inactive=300s;

log_format cs '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
Expand Down Expand Up @@ -60,7 +61,15 @@ server {

proxy_cache cs;
proxy_no_cache $do_not_cache;
proxy_cache_valid 10s;
proxy_cache_valid 15s;
}

location /flag_ids {
proxy_pass http://cs;

proxy_cache cs_flag_ids;
proxy_cache_valid 15s;
proxy_cache_key "$uri$is_args$args$http_x_team_token";
}

location /flags {
Expand Down

0 comments on commit 7810961

Please sign in to comment.