From 2337b03d94ef7b8dddac51590e122b7c251b4749 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Diemer?= <stephane.diemer@ubicast.eu>
Date: Wed, 1 Mar 2017 09:34:57 +0100
Subject: [PATCH] Revert APT proxy changes (refs #20417).

---
 2.Common_services/5.Nginx/vhost_skyreach.conf | 37 ++-----------------
 1 file changed, 4 insertions(+), 33 deletions(-)

diff --git a/2.Common_services/5.Nginx/vhost_skyreach.conf b/2.Common_services/5.Nginx/vhost_skyreach.conf
index 51bbed1c..039f20ff 100644
--- a/2.Common_services/5.Nginx/vhost_skyreach.conf
+++ b/2.Common_services/5.Nginx/vhost_skyreach.conf
@@ -40,43 +40,14 @@ server {
 		include /etc/nginx/uwsgi_params;
 	}
 
-	# Old APT proxy urls
+	# APT proxy urls
 	location /fr.archive.ubuntu.com/ubuntu {
-		rewrite ^/(.*)$ /apt/http/$1?;
+		proxy_pass http://127.0.0.1:3142;
 	}
 	location /security.ubuntu.com/ubuntu {
-		rewrite ^/(.*)$ /apt/http/$1?;
+		proxy_pass http://127.0.0.1:3142;
 	}
 	location /old-releases.ubuntu.com/ubuntu {
-		rewrite ^/(.*)$ /apt/http/$1?;
-	}
-	# APT proxy
-	location /apt {
-		location ~ ^/apt/(http|https)/([\w\.\-\_]+.ubuntu.com/ubuntu|ftp.debian.org/debian|panel.ubicast.eu)/(.*)$ {
-			resolver 127.0.0.1;
-			proxy_pass $1://$2/$3;
-			proxy_cache uc-apt-cache;
-			# do not consider secure urls as new files
-			proxy_cache_key $scheme$proxy_host$uri;
-			# only one request at a time will be allowed to populate a new cache element
-			proxy_cache_lock on;
-			# how long should the data be kept in the cache
-			proxy_cache_valid 200 7d;
-			# instruct browser to cache this
-			expires 7d;
-			# headers
-			proxy_ignore_headers "Cache-Control" "X-Accel-Expires" "Expires";
-			add_header X-Cache $upstream_cache_status;
-		}
-	}
-}
-
-server {
-	# Replacement of apt-cacher-ng
-	listen 3142;
-
-	location / {
-		resolver 127.0.0.1;
-		proxy_pass http://{{ server_name }}/apt/$scheme/$host$request_uri;
+		proxy_pass http://127.0.0.1:3142;
 	}
 }
-- 
GitLab