Skip to content

Instantly share code, notes, and snippets.

@jeremyfelt
Last active May 14, 2019 18:02
Show Gist options
  • Save jeremyfelt/08df225addf33f382341 to your computer and use it in GitHub Desktop.
Save jeremyfelt/08df225addf33f382341 to your computer and use it in GitHub Desktop.
Nginx configuration to proxy 404 files locally to a production domain
# Adjust this to include any other necessary files.
location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
expires 24h;
log_not_found off;
try_files $uri $uri/ @production;
}
location @production {
resolver 1.1.1.1;
proxy_pass http://{replace-with.domain.com}/$uri;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment