[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
01/02: nginx: Add '/file' URLs for the 'guix publish' content-addressed
From: |
Ludovic Courtès |
Subject: |
01/02: nginx: Add '/file' URLs for the 'guix publish' content-addressed storage. |
Date: |
Sun, 31 Jul 2016 16:12:12 +0000 (UTC) |
civodul pushed a commit to branch master
in repository maintenance.
commit 7f59985566b384e31da7e6f1a36744e9edfba54f
Author: Ludovic Courtès <address@hidden>
Date: Sun Jul 31 16:04:33 2016 +0200
nginx: Add '/file' URLs for the 'guix publish' content-addressed storage.
---
hydra/nginx/hydra.gnu.org-locations.conf | 10 ++++++++++
hydra/nginx/mirror-locations.conf | 11 +++++++++++
hydra/nginx/mirror.conf | 7 +++++++
3 files changed, 28 insertions(+)
diff --git a/hydra/nginx/hydra.gnu.org-locations.conf
b/hydra/nginx/hydra.gnu.org-locations.conf
index 0a2fa7c..8a06590 100644
--- a/hydra/nginx/hydra.gnu.org-locations.conf
+++ b/hydra/nginx/hydra.gnu.org-locations.conf
@@ -107,6 +107,16 @@ location ~ \.narinfo$ {
proxy_ignore_headers Set-Cookie;
}
+# Content-addressed files served by 'guix publish'. No need to cache
+# it because it is served right from the store without any additional
+# processing.
+location /file/ {
+ # Launch as 'guix publish -p 9999 -u nobody --listen=127.0.0.1'.
+ proxy_pass http://127.0.0.1:9999;
+
+ proxy_connect_timeout 3s;
+}
+
# For use by Certbot.
location /.well-known {
root /var/www;
diff --git a/hydra/nginx/mirror-locations.conf
b/hydra/nginx/mirror-locations.conf
index 976729c..9fc9e34 100644
--- a/hydra/nginx/mirror-locations.conf
+++ b/hydra/nginx/mirror-locations.conf
@@ -109,6 +109,17 @@ location /log/ {
proxy_ignore_headers Set-Cookie;
}
+# Content-addressed files served by 'guix publish'.
+location /file/ {
+ proxy_pass http://hydra.gnu.org;
+
+ proxy_cache cas;
+ proxy_cache_valid 200 200d; # cache hits
+ proxy_cache_valid any 5m; # cache misses/others
+
+ proxy_ignore_client_abort on;
+}
+
# For use by Certbot.
location /.well-known {
root /var/www;
diff --git a/hydra/nginx/mirror.conf b/hydra/nginx/mirror.conf
index 7972601..d169617 100644
--- a/hydra/nginx/mirror.conf
+++ b/hydra/nginx/mirror.conf
@@ -56,6 +56,13 @@ http {
keys_zone=nar:8m # nar cache meta data: ~64K keys
max_size=100g; # total cache data size max
+ # cache for content-addressed files
+ proxy_cache_path /var/cache/nginx/cas
+ levels=2
+ inactive=180d # inactive keys removed after 180d
+ keys_zone=cas:8m # nar cache meta data: ~64K keys
+ max_size=30g; # total cache data size max
+
# cache for static data
proxy_cache_path /var/cache/nginx/static
levels=1