Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

catch / handle 301 redirects and save the blobs #6

Open
MaxPeal opened this issue Jun 25, 2020 · 1 comment
Open

catch / handle 301 redirects and save the blobs #6

MaxPeal opened this issue Jun 25, 2020 · 1 comment

Comments

@MaxPeal
Copy link

MaxPeal commented Jun 25, 2020

can we add a funktion to catch 301 redirects to https and save the blobs?
so a http reqest form client will be saved to disk / cache form nginx.
and than the client get the file form nginx.

to cache / save files on github, as github hase a forced 301 to https
without the need of a MitM CA cert on any clients,
as the get the files still only in plan http.

mybe something in this way:
location /images/ {
root /data/www;
error_page 404 = @fetch;
}

location @fetch {
internal;

proxy_pass         http://backend;
proxy_store        on;
proxy_store_access user:rw group:rw all:r;
proxy_temp_path    /data/temp;

root               /data/www;

}
https://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_store

mybe some other way? https://github.com/rpardini/docker-registry-proxy/blob/2c8be197be3e74714b53df6b62d2f39029086dc4/nginx.conf#L227

@tianon
Copy link
Owner

tianon commented Dec 19, 2020

Sorry for the delay! This is a cute hack, but IMO this would encourage folks to use non-https URLs, which I think is a net loss. 😕 😞

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants