Skip to content

Instantly share code, notes, and snippets.

@IlanVivanco
Last active March 20, 2023 17:07
Show Gist options
  • Save IlanVivanco/e041b4301921b17a9240d73599005f03 to your computer and use it in GitHub Desktop.
Save IlanVivanco/e041b4301921b17a9240d73599005f03 to your computer and use it in GitHub Desktop.
Rewrite local images to remote server.
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{HTTP_HOST} ^camunda\.test$
RewriteRule ^wp-content/uploads/(.*)$ https://camunda.com/wp-content/uploads/$1 [NC,L]
</IfModule>
#
# Static file rules
#
location ~* \.(?:css|js)$ {
access_log off;
log_not_found off;
add_header Cache-Control "no-cache, public, must-revalidate, proxy-revalidate";
}
location ~* \.(?:jpg|jpeg|gif|png|ico|xml)$ {
access_log off;
log_not_found off;
expires 5m;
add_header Cache-Control "public";
try_files $uri $uri/ @production;
}
location ~* \.(?:eot|woff|woff2|ttf|svg|otf) {
access_log off;
log_not_found off;
expires 5m;
add_header Cache-Control "public";
# allow CORS requests
add_header Access-Control-Allow-Origin *;
try_files $uri $uri/ @production;
}
location @production {
resolver 8.8.8.8;
proxy_pass https://www.womenspowergap.org/$uri;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment