Skip to content

Instantly share code, notes, and snippets.

@themasch
Created September 21, 2018 09:38
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 themasch/646bcf9b09641d67f7b1eb89d2303f9d to your computer and use it in GitHub Desktop.
Save themasch/646bcf9b09641d67f7b1eb89d2303f9d to your computer and use it in GitHub Desktop.
proxy_cache_path /var/cache/nginx/npm_cache levels=1:2 keys_zone=npm_cache:10m;
upstream npm_registry {
server registry.npmjs.org:443;
}
server {
listen 80;
server_name blblabla;
proxy_set_header Host registry.npmjs.org;
location / {
proxy_ignore_headers Cache-Control;
proxy_cache npm_cache;
proxy_cache_valid 5m;
add_header X-Cache $upstream_cache_status;
proxy_pass https://npm_registry;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment