Revisions
-
ei-grad created this gist
Mar 21, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,42 @@ # /etc/nginx/conf.d/conda.conf proxy_cache_path /var/cache/nginx/conda levels=2:2 keys_zone=conda:100m inactive=14d max_size=10g; upstream conda.anaconda.org { server 104.17.92.24:443; server 104.17.93.24:443; } server { listen 80; server_name conda.anaconda.org conda-proxy; location / { proxy_cache conda; proxy_cache_valid 200 365d; proxy_cache_key $request_uri; proxy_pass https://conda.anaconda.org; proxy_http_version 1.1; proxy_set_header Host "conda.anaconda.org"; proxy_set_header Connection ""; proxy_intercept_errors on; error_page 302 = @handle_redirect; } location @handle_redirect { proxy_cache conda; proxy_cache_valid 200 365d; set $saved_uri '$uri'; proxy_cache_key $saved_uri; set $saved_redirect_location '$upstream_http_location'; proxy_pass $saved_redirect_location; proxy_http_version 1.1; proxy_set_header Connection ""; resolver 127.0.0.1; // CHANGE IF THERE IS NO LOCAL DNS CACHE } location ~ .json$ { proxy_pass https://conda.anaconda.org; proxy_cache_valid 200 1d; proxy_cache_key $request_uri; proxy_http_version 1.1; proxy_set_header Host "conda.anaconda.org"; proxy_set_header Connection ""; } } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,3 @@ echo 127.0.0.123 conda-proxy >> /etc/hosts conda config --add channels http://conda-proxy/main conda config --add channels http://conda-proxy/conda-forge