Use correct protocol for pypi reverse proxy
When reverse proxying pypi the current implementation uses https to communicate upstream. This works just fine if the upstream pypi server is serving data via https, but causes the handshake to fail if the upstream pypi server is serving via http instead. This patch implements a check to validate the upstream pypi server port set and adapts the reverse proxy configuration appropriately. Change-Id: I1a986fef5bf1e069212bc432c3a775be15df11ef Implements: blueprint python-build-install-simplification Signed-off-by: Jesse Pretorius <jesse.pretorius@rackspace.co.uk>
This commit is contained in:
parent
5c0f04f694
commit
09a058f3f7
|
@ -25,7 +25,11 @@ server {
|
||||||
# http://linuxplayer.org/2013/06/nginx-try-files-on-multiple-named-location-or-server
|
# http://linuxplayer.org/2013/06/nginx-try-files-on-multiple-named-location-or-server
|
||||||
location @pypi {
|
location @pypi {
|
||||||
proxy_set_header Host pypi.python.org;
|
proxy_set_header Host pypi.python.org;
|
||||||
|
{% if repo_nginx_pypi_upstream | match('.*:443$') %}
|
||||||
proxy_pass https://pypi;
|
proxy_pass https://pypi;
|
||||||
|
{% else %}
|
||||||
|
proxy_pass http://pypi;
|
||||||
|
{% endif %}
|
||||||
}
|
}
|
||||||
|
|
||||||
location /simple {
|
location /simple {
|
||||||
|
|
Loading…
Reference in New Issue