[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
01/02: nginx: mirror: Proxy and cache /log URLs.
From: |
Ludovic Courtès |
Subject: |
01/02: nginx: mirror: Proxy and cache /log URLs. |
Date: |
Wed, 15 Jun 2016 08:53:11 +0000 (UTC) |
civodul pushed a commit to branch master
in repository maintenance.
commit 539f7351d749e25c73e90877ea159d495ed4d4b0
Author: Ludovic Courtès <address@hidden>
Date: Wed Jun 15 10:48:14 2016 +0200
nginx: mirror: Proxy and cache /log URLs.
---
hydra/nginx/mirror-locations.conf | 17 +++++++++++++++++
hydra/nginx/mirror.conf | 7 +++++++
2 files changed, 24 insertions(+)
diff --git a/hydra/nginx/mirror-locations.conf
b/hydra/nginx/mirror-locations.conf
index 3e58859..976729c 100644
--- a/hydra/nginx/mirror-locations.conf
+++ b/hydra/nginx/mirror-locations.conf
@@ -92,6 +92,23 @@ location ~ \.narinfo$ {
proxy_ignore_headers Set-Cookie;
}
+location /log/ {
+ proxy_pass http://hydra.gnu.org;
+
+ # Enable caching for build logs.
+ proxy_cache logs;
+ proxy_cache_valid 200 60d; # cache hits.
+ proxy_cache_valid 504 3m; # timeout, when hydra.gnu.org is overloaded
+ proxy_cache_valid any 1h; # cache misses/others.
+
+ proxy_ignore_client_abort on;
+
+ # We need to hide and ignore the Set-Cookie header
+ # to enable caching.
+ proxy_hide_header Set-Cookie;
+ proxy_ignore_headers Set-Cookie;
+}
+
# For use by Certbot.
location /.well-known {
root /var/www;
diff --git a/hydra/nginx/mirror.conf b/hydra/nginx/mirror.conf
index a19a2e9..14f163a 100644
--- a/hydra/nginx/mirror.conf
+++ b/hydra/nginx/mirror.conf
@@ -63,6 +63,13 @@ http {
keys_zone=static:1m # nar cache meta data: ~8K keys
max_size=2m; # total cache data size max
+ # cache for build logs
+ proxy_cache_path /var/cache/nginx/logs
+ levels=2
+ inactive=60d # inactive keys removed after 60d
+ keys_zone=logs:8m # narinfo meta data: ~64K keys
+ max_size=4g; # total cache data size max
+
# We'd rather fail early than wait forever for hydra.gnu.org.
proxy_connect_timeout 5s;
proxy_read_timeout 10s;