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

voku nginx-forum at nginx.us
Sun Oct 24 04:35:33 MSD 2010


Hi, I want to speed up my WordPress Blog ... so I want to rewrite
"js/css.php" to ".js/.css" files. I tested this rewrite rules ...

[code]
## 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;
                }
        }
[/code]

... but it make only this ...

"http://suckup.de/wp-content/plugins/wp-special-textboxes/css/?ver=3.0.1"
-> 
"http://suckup.de/wp-content/cache/wp-special-textboxes.css?ver=3.0.12

... and not thia ...

"http://suckup.de/wp-content/plugins/wp-special-textboxes/css/wp-special-textboxes.css.php?ver=3.0.1"
"http://suckup.de/wp-content/cache/wp-special-textboxes.css"

... can someone, please help !?!? Thx!

And I have a second question, I today also tested "varnish" (on port 80)
with "nginx" (on port 8080), but I have the problem that there are some
of this entries in the html-sources -> "@import
"http://suckup.de:8080/?mystique=css";" ... so can someone say me how I
can rewrite the port to 80, thx in advance?


Mfg
Voku

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,143963,143963#msg-143963




More information about the nginx mailing list