-
-
Notifications
You must be signed in to change notification settings - Fork 702
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
Fallback to the Internet if Images cant be found local #1220
Comments
I have managed to modify the nginx config to do this on my instance with the following settings server {
listen [NGINX_PORT];
resolver 8.8.8.8;
location / {
root /assets;
autoindex on;
try_files $uri $uri/ @fallback;
}
location @fallback{
rewrite ^/(.*) /netbootxyz/$1 break;
proxy_pass https://github.com;
#proxy_redirect / /;
proxy_intercept_errors on;
error_page 301 302 307 = @handle_redirect;
}
location @handle_redirect {
set $saved_redirect_location '$upstream_http_location';
proxy_pass $saved_redirect_location;
}
} its not the best as its a combination of stuff from stackoverflow and some of my own config. the fallback is what redirects it to the github mirror if it cant find a file and the |
To add caching: proxy_cache_path /assets/cache keys_zone=fallback_cache:30720m levels=1:2 max_size=30720m inactive=30d;
proxy_buffer_size 128k;
proxy_buffers 4 256k;
proxy_busy_buffers_size 256k;
server {
listen 80;
resolver 8.8.8.8;
location / {
root /assets;
autoindex on;
try_files $uri $uri/ @fallback;
}
location @fallback {
rewrite ^/(.*) /netbootxyz/$1 break;
proxy_cache_revalidate on;
proxy_cache fallback_cache;
proxy_cache_valid 200 30d;
proxy_cache_use_stale error timeout invalid_header updating;
proxy_pass https://github.com;
proxy_intercept_errors on;
error_page 301 302 307 = @handle_redirect;
add_header X-Netboot-Cache $upstream_cache_status;
}
location @handle_redirect {
set $saved_redirect_location '$upstream_http_location';
proxy_cache_revalidate on;
proxy_cache fallback_cache;
proxy_cache_valid 200 30d;
proxy_cache_use_stale error timeout invalid_header updating;
proxy_pass $saved_redirect_location;
add_header X-Netboot-Cache $upstream_cache_status;
}
} |
I skipped the caching for now on my system, but I think you can simplify the nginx config (or at least it worked for me) by doing this to simply redirect the client to the public live server: server {
listen 80;
location / {
root /assets;
autoindex on;
try_files $uri $uri/ @fallback;
}
location @fallback{
return 307 https://github.com/netbootxyz$request_uri;
}
} |
Is your feature request related to a problem? Please describe.
No.
Describe the solution you'd like
If I change "set live_endpoint" to a local endpoint, netboot shoot try to find the image. If the image isnt found locally, an automatically fallback to https://github.com/netbootxyz should happen. Currently the Boot Process fails.
Describe alternatives you've considered
Download all the Images, thats nice but really not a solution for a Raspberry Pi Docker Container.
Additional context
The text was updated successfully, but these errors were encountered: