Welcome! Log In Create A New Profile

Advanced

Apache to NGINX, google minify stopped working.

Posted by zeeshan.m.malik 
Apache to NGINX, google minify stopped working.
September 27, 2010 07:39AM
Hello,

I am using google minify(http://code.google.com/p/minify/) to minify js and css files.I am migrating from apache to nginx. After migration my js and css urls(e.g: http://mydomain.com/min/?g=group_name) which use minify have stopped working. Nginx returns 'HTTP/1.0 400 Bad Request' on all the urls using minfy.

When I visit the address http://mydomain.com/min, it does redirects to
http://mydomain.com/min/builder/ like it used to do with apache, but
instead of showing complete 'Minify URI Builder' page it only shows
following:
----------------------------------------------------------------------------------------
Minify URI Builder

Need help? Search or post to the Minify discussion list.

This app is minified :) view source
-----------------------------------------------------------------------------------------

In firebug I can see that the request http://example.com/min/?f=min/builder/_index.js
also returns 'HTTP/1.0 400 Bad Request' when i try to access
http://mydomain.com/min.

My server configuration for nginx is as following:
-------------------------------------------------------------------------------------------
server {
listen 80;
server_name example.com;

location / {
root /path/to/root/dir;
index index.php index.html index.htm;
}


# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}


location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /path/to/root/dir/
$fastcgi_script_name;
include fastcgi_params;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
}

}
-------------------------------------------------------------------------------------------

Please help me in configuring google minify with nginx.

Thanks,
ZM.
Re: Apache to NGINX, google minify stopped working.
September 28, 2010 03:16AM
I got it working.

I installed FirePHP and got following error while trying to fetch http://mydomain.com/min/?f=min/builder/_index.js:

Minify: Path "/usr/local/nginx/html/min/builder/_index.js" failed Minify_Controller_Base::_fileIsSafe()

My min directory is placed in /mydomain's/root/directory/min whereas nginx is trying to find it in it's html directory.

So i had to set the path of min to get it right. I set the $min_documentRoot
configuration parameter in config.php of min.

$min_documentRoot = '/path/to/root/directory/for/my/domain';

and it started working fine.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 124
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready