Skip to content
Snippets Groups Projects
Commit e6ec9205 authored by Stéphane Diemer's avatar Stéphane Diemer
Browse files

Changed APT proxy in skyreach Nginx conf (refs #20417).

parent e29f1a30
No related branches found
No related tags found
No related merge requests found
proxy_cache_path /tmp/nginx-uc-apt-cache levels=1:2 keys_zone=uc-apt-cache:10m max_size=4g inactive=300s;
server {
listen 80;
server_name {{ server_name }};
......@@ -38,14 +40,33 @@ server {
include /etc/nginx/uwsgi_params;
}
# Ubuntu
# Old APT proxy urls
location /fr.archive.ubuntu.com/ubuntu {
proxy_pass http://127.0.0.1:3142;
rewrite ^/(.*)$ /apt/http/$1?;
}
location /security.ubuntu.com/ubuntu {
proxy_pass http://127.0.0.1:3142;
rewrite ^/(.*)$ /apt/http/$1?;
}
location /old-releases.ubuntu.com/ubuntu {
proxy_pass http://127.0.0.1:3142;
rewrite ^/(.*)$ /apt/http/$1?;
}
# APT proxy
location /apt {
location ~ ^/apt/(http|https)/([\w\.\-\_]+.ubuntu.com/ubuntu|panel.ubicast.eu/packaging/apt)/(.*)$ {
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;
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment