Skip to content

Commit ce4bacc

Browse files
committed
Change status codes cached, cache for longer, expose nginx_status
1 parent 1710281 commit ce4bacc

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

nginx.conf

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,37 +74,41 @@ http {
7474
location / {
7575
proxy_set_header Connection "";
7676
proxy_set_header Accept-Encoding "";
77-
proxy_cache_valid any 5m;
77+
proxy_cache_valid 200 301 10m;
7878
proxy_cache_valid 404 1m;
7979

8080
proxy_set_header Host pypi.org;
8181
proxy_ssl_name pypi.org;
82-
proxy_pass https://sg_pypi;
82+
proxy_pass 'https://sg_pypi';
8383
proxy_redirect 'https://pypi.org' $scheme://$host;
8484
}
8585

8686
location ^~ /simple {
8787
proxy_set_header Connection "";
8888
proxy_set_header Accept-Encoding "";
89-
proxy_cache_valid any 5m;
89+
proxy_cache_valid 200 301 10m;
9090
proxy_cache_valid 404 1m;
9191

9292
proxy_set_header Host pypi.org;
9393
proxy_ssl_name pypi.org;
94-
proxy_pass https://sg_pypi;
94+
proxy_pass 'https://sg_pypi';
9595
proxy_redirect 'https://pypi.org' $scheme://$host;
9696
}
9797

9898
location ^~ /packages {
9999
proxy_set_header Connection "";
100100
proxy_set_header Accept-Encoding "";
101-
proxy_cache_valid any 1M;
101+
proxy_cache_valid 200 301 1M;
102102
proxy_cache_valid 404 1m;
103103

104104
proxy_set_header Host files.pythonhosted.org;
105105
proxy_ssl_name files.pythonhosted.org;
106106
proxy_pass 'https://sg_pythonhosted/packages';
107107
proxy_redirect 'https://files.pythonhosted.org/packages' $scheme://$host/packages;
108108
}
109+
110+
location /nginx_status {
111+
stub_status;
112+
}
109113
}
110114
}

0 commit comments

Comments
 (0)