Created
May 11, 2019 06:49
-
-
Save RiFi2k/5c41dfba2e4ea7b57d2daa82b47a7ca7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
location ~* ^.+\.(svg|svgz|jpg|jpeg|gif|png|ico|bmp)$ { | |
try_files $uri $uri/ @stage; | |
} | |
location @stage { | |
resolver 8.8.8.8; | |
rewrite ^/wp-content/(.*) /$1; # In S3, the path starts with /uploads | |
proxy_pass http://stagebucket.s3-website-us-east-1.amazonaws.com$uri; | |
proxy_intercept_errors on; | |
error_page 404 = @production; | |
} | |
location @production { | |
resolver 8.8.8.8; | |
rewrite ^/wp-content/(.*) /$1; # In S3, the path starts with /uploads | |
proxy_pass http://prodbucket.s3-website-us-east-1.amazonaws.com$uri; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment