From ce4bacc713486e24031766d4630caaeded86b3c0 Mon Sep 17 00:00:00 2001 From: hauntsaninja Date: Thu, 3 Oct 2024 20:54:24 -0700 Subject: [PATCH] Change status codes cached, cache for longer, expose nginx_status --- nginx.conf | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/nginx.conf b/nginx.conf index d2b2509..cb2c195 100644 --- a/nginx.conf +++ b/nginx.conf @@ -74,31 +74,31 @@ 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; @@ -106,5 +106,9 @@ http { proxy_pass 'https://sg_pythonhosted/packages'; proxy_redirect 'https://files.pythonhosted.org/packages' $scheme://$host/packages; } + + location /nginx_status { + stub_status; + } } }