Last active
December 8, 2020 07:47
-
-
Save SmartHypercube/73dace294571e72315a4df5305cb8cec to your computer and use it in GitHub Desktop.
Nginx APT proxy for docker builds
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# $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