Skip to content

Commit

Permalink
Change status codes cached, cache for longer, expose nginx_status
Browse files Browse the repository at this point in the history
  • Loading branch information
hauntsaninja committed Oct 4, 2024
1 parent 1710281 commit ce4bacc
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -74,37 +74,41 @@ http {
location / {
proxy_set_header Connection "";
proxy_set_header Accept-Encoding "";
proxy_cache_valid any 5m;
proxy_cache_valid 200 301 10m;
proxy_cache_valid 404 1m;

proxy_set_header Host pypi.org;
proxy_ssl_name pypi.org;
proxy_pass https://sg_pypi;
proxy_pass 'https://sg_pypi';
proxy_redirect 'https://pypi.org' $scheme://$host;
}

location ^~ /simple {
proxy_set_header Connection "";
proxy_set_header Accept-Encoding "";
proxy_cache_valid any 5m;
proxy_cache_valid 200 301 10m;
proxy_cache_valid 404 1m;

proxy_set_header Host pypi.org;
proxy_ssl_name pypi.org;
proxy_pass https://sg_pypi;
proxy_pass 'https://sg_pypi';
proxy_redirect 'https://pypi.org' $scheme://$host;
}

location ^~ /packages {
proxy_set_header Connection "";
proxy_set_header Accept-Encoding "";
proxy_cache_valid any 1M;
proxy_cache_valid 200 301 1M;
proxy_cache_valid 404 1m;

proxy_set_header Host files.pythonhosted.org;
proxy_ssl_name files.pythonhosted.org;
proxy_pass 'https://sg_pythonhosted/packages';
proxy_redirect 'https://files.pythonhosted.org/packages' $scheme://$host/packages;
}

location /nginx_status {
stub_status;
}
}
}

0 comments on commit ce4bacc

Please sign in to comment.