YA Converting .htaccess to nginx, I can't get it to work!

Hi all,
I am trying to convert this htaccess file to nginx config and it is not
working.
Here is my .htaccess

Header unset ETag FileETag None Header unset Last-Modified Header set Expires "Fri, 21 Dec 2020 00:00:00 GMT" Header set Cache-Control "public, no-transform" RewriteEngine On RewriteCond %{QUERY_STRING} ^$ RewriteRule ^((.)?)$ index.php?p=home [L]
    RewriteCond %{REQUEST_FILENAME} -f
    RewriteRule ^(.*)$ $1 [QSA,L]

    RewriteCond     $1

!^(#(.)|?(.)|.htaccess(.)|.htaccess.back(.)|.idea/(.)|.svn/(.)|admin.php(.)|content/(.)|download.php(.)|ecc/(.)|images/(.)|index.php(.)|install/(.)|login.php(.)|readme.txt(.)|robots.txt(.))
RewriteRule ^(.+)$ index.php?url=$1&%{QUERY_STRING} [L]

SetOutputFilter DEFLATE

and here is my config. I can get it to somewhat work if I only use one
of
the following lines but then the rest is broke!

location / {
if ($query_string ~ “^$”){
rewrite ^/((.)?)$ /index.php?p=home break;
}
if (-e $request_filename){
rewrite ^(.*)$ /$1 break;
}
rewrite ^(.+)$ /index.php?url=$1&$query_string break;
location ~ .php$ {
try_files $uri =404;
fastcgi_pass unix:/tmp/php5-fpm.sock;
fastcgi_index index.php;
include /etc/nginx/fastcgi_params;
}

}

Not to mention that I hate using the if else clauses in my nginx config
because I think I read where it is poor for performance.

Can someone give me a hand here. I have been working on this for hours
without any luck.
John

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

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs