Skip to content

Instantly share code, notes, and snippets.

@SmartHypercube
Last active December 8, 2020 07:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SmartHypercube/73dace294571e72315a4df5305cb8cec to your computer and use it in GitHub Desktop.
Save SmartHypercube/73dace294571e72315a4df5305cb8cec to your computer and use it in GitHub Desktop.
Nginx APT proxy for docker builds
proxy_cache_path /var/lib/nginx/proxy_cache levels=2 keys_zone=apt-cache:10m inactive=7d max_size=10g;
server {
listen 80;
listen [::]:80;
server_name deb.debian.org;
charset utf-8;
tcp_nodelay on;
server_tokens off;
types {}
default_type application/octet-stream;
location / {
proxy_pass http://mirrors.aliyun.com;
proxy_http_version 1.1;
proxy_cache apt-cache;
proxy_cache_valid 1d;
proxy_cache_revalidate on;
}
}
# $NGINX-SITES/apt/nginx.conf
proxy_cache_path /tmp/apt-cache levels=2 keys_zone=apt-cache:10m inactive=7d max_size=10g;
server {
listen 8080;
server_name deb.debian.org;
charset utf-8;
tcp_nodelay on;
server_tokens off;
types {}
default_type application/octet-stream;
location / {
proxy_pass http://mirrors.aliyun.com;
proxy_http_version 1.1;
proxy_cache apt-cache;
proxy_cache_valid 1d;
proxy_cache_revalidate on;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment