You've already forked pypi-proxy
feat: Add configurable TRANSPORT_SCHEME ✨
Some checks failed
CI / release (push) Failing after 1m29s
Some checks failed
CI / release (push) Failing after 1m29s
Can now set environment var TRANSPORT_SCHEME=http if you would want to revert from default https transport.
This commit is contained in:
@@ -18,6 +18,8 @@ VOLUME [ "/var/lib/nginx/pypi" ]
|
||||
EXPOSE 80
|
||||
|
||||
ENV TZ=Pacific/Auckland
|
||||
# Transport scheme default is https
|
||||
ENV TRANSPORT_SCHEME=https
|
||||
|
||||
ENTRYPOINT [ "/docker-entrypoint.sh" ]
|
||||
|
||||
|
||||
@@ -81,8 +81,8 @@ http {
|
||||
|
||||
location / {
|
||||
# Replace any reference to actual pypi w/ caching proxy
|
||||
sub_filter 'https://pypi.org' $scheme://$host;
|
||||
sub_filter 'https://files.pythonhosted.org' $scheme://%%PYPI_FILES_HOSTNAME%%;
|
||||
sub_filter 'https://pypi.org' %%TRANSPORT_SCHEME%%://$host;
|
||||
sub_filter 'https://files.pythonhosted.org' %%TRANSPORT_SCHEME%%://%%PYPI_FILES_HOSTNAME%%;
|
||||
sub_filter_once off;
|
||||
sub_filter_types '*';
|
||||
proxy_pass https://pypi;
|
||||
@@ -90,8 +90,8 @@ http {
|
||||
}
|
||||
|
||||
location ^~ /simple {
|
||||
sub_filter 'https://pypi.org' $scheme://$host;
|
||||
sub_filter 'https://files.pythonhosted.org' $scheme://%%PYPI_FILES_HOSTNAME%%;
|
||||
sub_filter 'https://pypi.org' %%TRANSPORT_SCHEME%%://$host;
|
||||
sub_filter 'https://files.pythonhosted.org' %%TRANSPORT_SCHEME%%://%%PYPI_FILES_HOSTNAME%%;
|
||||
sub_filter_types '*';
|
||||
sub_filter_once off;
|
||||
# Make sure URI ends with /
|
||||
@@ -128,7 +128,7 @@ http {
|
||||
|
||||
location / {
|
||||
# Replace any reference to actual pypi w/ caching proxy
|
||||
sub_filter 'https://files.pythonhosted.org' $scheme://%%PYPI_FILES_HOSTNAME%%;
|
||||
sub_filter 'https://files.pythonhosted.org' %%TRANSPORT_SCHEME%%://%%PYPI_FILES_HOSTNAME%%;
|
||||
sub_filter_once off;
|
||||
sub_filter_types '*';
|
||||
proxy_pass https://pypi-files;
|
||||
|
||||
Reference in New Issue
Block a user