Created
March 31, 2016 11:25
-
-
Save nkt/e24d697d9a675c5ab982e595ddd968a1 to your computer and use it in GitHub Desktop.
This file contains hidden or 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/www/npm_cache levels=2:2 keys_zone=npm_cache:10m max_size=20g inactive=1M use_temp_path=off; | |
server { | |
listen 80; | |
server_name npm.example.com; | |
location / { | |
rewrite ^ https://npm.example.com$request_uri permanent; | |
} | |
} | |
server { | |
listen 443 ssl http2; | |
server_name npm.example.com; | |
ssl on; | |
ssl_certificate /etc/nginx/ssl/npm.crt; | |
ssl_certificate_key /etc/nginx/ssl/npm.key; | |
access_log off; | |
error_log /var/log/npm.error.log notice; | |
location / { | |
proxy_pass https://registry.npmjs.org; | |
proxy_cache npm_cache; | |
proxy_cache_lock on; | |
proxy_cache_min_uses 1; | |
proxy_cache_revalidate off; | |
proxy_cache_use_stale error timeout invalid_header updating; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment