I am attempting to make my local host and staging environments a bit prettier by failing over to production if an image is not found locally. I can get proxy pass to work and always forward requests to our production environment, but I am not sure how to make the virtual host check locally, then conditionally forward to production on a 404.
<VirtualHost *:80> ServerName media.localhost ServerAlias media.localhost DocumentRoot /var/www/media-server/ SSLProxyEngine on ProxyPass / https://media.production.com/ </VirtualHost>
Alternatively I am not sure if proxy pass is even the best approach here? Maybe a mod_rewrite is better?
Edit: Additional context, image paths are stored relative to domain in the database, with the images stored in the file system. So when pulling in production data there are lots of broken images when developing locally.