Created
July 15, 2015 17:29
-
-
Save subuk/c99c2c5271cff5c40645 to your computer and use it in GitHub Desktop.
Nginx pypi cache
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
#!/bin/sh | |
pip install -t /tmp/test_install -i http://localhost:5555/simple/ django |
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 /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