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
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

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
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.

Posted at Nginx Forum: