Google Minify with nginx

I am using google minify and my URLs for including CSS and JS are something like

domain.com/min.php/commonjs
domain.com/min.php/commoncss
domain.com/min.php/jqueryall

I have moved to nginx with php-fpm and got the config as

 location ~ \.php {
                if (!-f $request_filename) {
                        return 404;
                }
                fastcgi_pass   127.0.0.1:9000;
                fastcgi_index  index.php;
                fastcgi_param  SCRIPT_FILENAME  /var/www/app.visualwebsiteoptimizer.com$fastcgi_script_name;
                include fastcgi_params;
        }

The minification is not working and the URLs are returning 404s. Can someone guide me as to what I can do to fix the same

Answer

You are using path info and as such you cannot check if the file exists because you rely on PHP to traverse the URI it’s given until it finds an existing file.

Please see this wiki page on how to handle it properly: http://wiki.nginx.org/HttpFcgiModule#fastcgi_split_path_info

Attribution
Source : Link , Question Author : Sparsh Gupta , Answer Author : Martin Fjordvald

Leave a Comment