server { listen 127.0.0.1; server_name test.com; access_log /var/www/test.com/log/access_log; error_log /var/www/test.com/log/error_log; location ~* ^.+\.(html|htm|jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js|mov)$ { root /var/www/test.com/html; } location / { set $scriptname ""; if ($fastcgi_script_name = "/") { set $scriptname "main"; } if ($fastcgi_script_name ~ ^/(.*)/$) { set $scriptname $1; } gzip off; #gzip makes scripts feel slower since they have to complete before getting gzipped fastcgi_pass 127.0.0.1:9090; fastcgi_param SCRIPT_FILENAME $scriptname; include /etc/nginx/fastcgi_params; } }