guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/01: hydra: nginx: Redirect hydra.gnu.org/nar to hydra.gnu.org/guix/na


From: Ludovic Courtès
Subject: 01/01: hydra: nginx: Redirect hydra.gnu.org/nar to hydra.gnu.org/guix/nar.
Date: Tue, 28 Nov 2017 08:05:58 -0500 (EST)

civodul pushed a commit to branch master
in repository maintenance.

commit 0908fbf02b2f13ac9d3650e12d3e0783c36bc889
Author: Ludovic Courtès <address@hidden>
Date:   Tue Nov 28 14:03:08 2017 +0100

    hydra: nginx: Redirect hydra.gnu.org/nar to hydra.gnu.org/guix/nar.
    
    This allows standard /nar URLs to work.
    
    * hydra/nginx/hydra.gnu.org-locations.conf (/nar): Turn into a permanent
    redirect to /guix/nar.
---
 hydra/nginx/hydra.gnu.org-locations.conf | 42 +++-----------------------------
 1 file changed, 4 insertions(+), 38 deletions(-)

diff --git a/hydra/nginx/hydra.gnu.org-locations.conf 
b/hydra/nginx/hydra.gnu.org-locations.conf
index c42416a..f42057d 100644
--- a/hydra/nginx/hydra.gnu.org-locations.conf
+++ b/hydra/nginx/hydra.gnu.org-locations.conf
@@ -54,44 +54,10 @@ location /guix/nar/ {
     gzip off;
 }
 
-location /nar/ {
-    # Legacy: served by Hydra.  Dumps are made by spawning
-    # "nix-store --export foo | bzip2", which is CPU-intensive.
-    # Additionally, Starman (Hydra's HTTP server) seems to be pretty slow.
-    proxy_pass http://127.0.0.1:3000;
-
-    client_body_buffer_size 256k;
-
-    # Enable caching for nar files, to avoid reconstructing and recompressing
-    # archives.
-    proxy_cache nar;
-    proxy_cache_valid 200 15d;  # cache hits for 15 days.
-    proxy_cache_valid 504 3m;   # timeout, when the machine is overloaded
-    proxy_cache_valid any 1m;   # cache misses/others for 1 min.
-
-    proxy_ignore_client_abort on;
-
-    # Be more tolerant of delays when fetching a nar.  Using a shorter
-    # timeout leads to users retrying, which in turn triggers another
-    # "nix-store --dump foo | bzip2" process, which quickly brings the
-    # machine down.
-    proxy_read_timeout 60s;
-    proxy_send_timeout 60s;
-
-    # Send only one request at a time for a given URI to the proxied
-    # server.
-    proxy_cache_lock on;
-
-    # Disable chunked encoding to avoid enormous chunks.
-    #chunked_transfer_encoding off;
-
-    # Nars are already compressed.
-    gzip off;
-
-    # We need to hide and ignore the Set-Cookie header
-    # to enable caching.
-    proxy_hide_header    Set-Cookie;
-    proxy_ignore_headers Set-Cookie;
+location ~ ^/nar/(.*)$ {
+    # This used to be the URL for the Hydra-served nars.  Now this is
+    # simply a redirect to the 'guix publish' URLs above.
+    return 301 /guix/nar/$1;
 }
 
 location ~ /(nix-cache-info|static|logo|favicon\.ico) {



reply via email to

[Prev in Thread] Current Thread [Next in Thread]