I'm assuming this is an easy one for anyone with nginx
knowledge.
I'm calling a URL like this:
/site-preview/css/custom-styles.css?org=myorg
The file custom-styles.css
doesn't actually exist. So, I want to rewrite the URL to actually serve this:
/css/custom-styles.php?org=myorg
I'm coming from the apache world where I have this working in my .htaccess
file.
In my nginx
config I've tried things like:
location /site-preview {
rewrite ^/site-preview/css/custom-styles.css?(.*) /css/custom-styles.php?$1 last;
}
and:
location /site-preview {
rewrite ^css/custom-styles.css?(.*) /css/custom-styles.php?$1 last;
}
as well as having the rewrite
outside of a location
block.
Thanks in advance.