Hi guys, I need your help. I'm desperately trying but fail with every try.
In PHP I have the following:
<?php
echo '<link rel="stylesheet" href="/style-'. md5_file(IP .'style.css') .'.css"/>';
echo '<script href="/script-'. md5_file(IP .'script.js') .'.js"></script>';
?>
If any of you isn't familiar with this, it outputs something like /style-bb2a053b6748240451d2e2952d284d52.css
Okay, so now I want to map this easily to another location on my server with nginx and this part just won't do as I want. I tried endless things I found here in the forum and elsewhere, but nothing works. Any help is much appreciated.
## Cache buster for style and script.
location ^~ /(style|script)-(.*)\.(css|js)$ {
rewrite /sites/all/themes/mytheme/$1.$3 last;
}
As I said, I tried different variations of this rewrite, I also tried alias instead of rewrite ... nothing works. ;(