Skip to content

Instantly share code, notes, and snippets.

@mcascardi
Created September 21, 2020 22:16
Show Gist options
  • Save mcascardi/e4358869b179fe877f2cc79c28642eaf to your computer and use it in GitHub Desktop.
Save mcascardi/e4358869b179fe877f2cc79c28642eaf to your computer and use it in GitHub Desktop.
# Nginx example configuration, added inside the server {} block
# Uploads redirected to the hostname of your production server
location /wp-content/uploads/ {
try_files $uri @uploads-redirect;
}
location @uploads-redirect {
expires 30s;
return 301 https://{HOSTNAME}/$request_uri;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment