minified js and css dont work on nginx




Wordpress LScache Plugin: minified js and css dont work on nginx

Last Updated on: Wed, 15 Apr 2026 00:00:02
Hi, after enabling css and js minifi and compress, the site return an 404 error on /min/xxxx.css and /min/xxxx.js , I undestand that its because the plugin create an .httaccess rewrite rule, but Im using nginx. So, how can I use nginx? Is there an rewrite rule to nginx? This topic was modified 4 years, 1 month ago by Henry ?vila. Hi, Please convert following rule into nginx sytle. htaccess: RewriteEngine on RewriteCond % DOCUMENT_ROOT % REQUEST_URI ^(. )/min/( w+) .(css|js)$ RewriteCond %1/wp-content/cache/$2/$1.$2 -f RewriteRule min/( w+) .(css|js) wp-content/cache/$2/$1.$2 [L] nginx: location / rewrite min/( w+) .(css|js) /wp-content/cache/$2/$1.$2 break nginx rule converted by Googling , untested , please adjust it if needed. Best regards, Hi, the provided code dont work, but I chaged it and its now working. The working code for nginx 1.12.2 is location .(css|js)$ rewrite ^/min/(. ) .(css|js)$ /wp-content/cache/$2/$1.$2 last Thanks for the help!



LiteCache Rush: Speed comes from using less, not from doing it faster



Reference