Skip to content

Instantly share code, notes, and snippets.

@subuk
Created July 15, 2015 17:29
Show Gist options
  • Save subuk/c99c2c5271cff5c40645 to your computer and use it in GitHub Desktop.
Save subuk/c99c2c5271cff5c40645 to your computer and use it in GitHub Desktop.
Nginx pypi cache
#!/bin/sh
pip install -t /tmp/test_install -i http://localhost:5555/simple/ django
proxy_cache_path /tmp/pypi_nginx_cache levels=1:2 keys_zone=PYPI:200m;
server {
listen 127.0.0.1:5555;
location / {
proxy_pass https://pypi.python.org;
proxy_cache PYPI;
proxy_cache_valid 200 1d;
proxy_cache_use_stale error timeout invalid_header updating http_500 http_502 http_503 http_504;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment