rewrite question - "(css/js).php" to "(.css/.js)"

voku nginx-forum at
Sun Oct 24 06:30:41 MSD 2010

Hi, I want to speed up my WordPress-Blog and so I want to cache
"css.php", "js.php" files to ".css", ".js"

for example I want to rewrite ... this ->



I had experiment with this rule...

## Optimierung - "(css/js).php" to "(css/js)"
        location /wp-content/plugins/wp-special-textboxes/css/ {
                if ($args ~ "ver=(.*)") {
                        rewrite ^/?(.*)
$scheme://$host/wp-content/cache/wp-special-textboxes.css permanent;
        location /wp-content/plugins/wp-special-textboxes/js/ {
                if ($args ~ "ver=(.*)") {
                        rewrite ^/?(.*)
$scheme://$host/wp-content/cache/wstb.js permanent;

but this only rewrite



Can someone please help me, thx! :-)

I have a second problem with the rewrite... I use varnish on port 80 and
nginx on port 8080, but some files from my WordPress-Theme want to use
something like this "@import
... can someone say me how to rewrite the port to 80, thx!?!?  :-)


Posted at Nginx Forum:,143927,143927#msg-143927

More information about the nginx mailing list