Is it possible to setup nginx to reverse proxy to a server, but if the file doens't exist on server A to then have a fallback to server B where the file definitely will be.
I need to do a 2TB S3 migration and it would simplify the process if nginx could be setup this way.
Here is what I'm using as a reverse proxy config currently:
http {
proxy_cache_path /data/nginx/cache levels=1:2 keys_zone=STATIC:100m
inactive=30d max_size=10g;
server {
location /image/ {
proxy_pass https://origin.example.com/;
proxy_set_header Host origin.example.com;
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_cache STATIC;
proxy_cache_valid 200 30d;
proxy_cache_use_stale error timeout invalid_header updating
http_500 http_502 http_503 http_504;
}