title: Apache htaccess rules converting to Nginx rules
body: <p>I need to translate some htaccess rules for the nginx server,</p>
  
  <p>my htaccess was:</p>
  
  <pre><code>RewriteEngine On
  RewriteBase /mysite
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ /mysite/index.php/$1 [L]
  
  SetOutputFilter DEFLATE
  
  &lt;ifModule mod_gzip.c&gt;
    mod_gzip_on Yes
    mod_gzip_dechunk Yes
    mod_gzip_item_include file \.(html?|txt|css|js|php|pl)$
    mod_gzip_item_include handler ^cgi-script$
    mod_gzip_item_include mime ^text/.*
    mod_gzip_item_include mime ^application/x-javascript.*
    mod_gzip_item_exclude mime ^image/.*
    mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
  &lt;/ifModule&gt;
  
  &lt;ifModule mod_expires.c&gt;
    ExpiresActive On
    ExpiresDefault "access plus 1 seconds"
    ExpiresByType text/html "access plus 1 seconds"
    ExpiresByType image/gif "access plus 2592000 seconds"
    ExpiresByType image/jpeg "access plus 2592000 seconds"
    ExpiresByType image/png "access plus 2592000 seconds"
    ExpiresByType text/css "access plus 604800 seconds"
    ExpiresByType text/javascript "access plus 216000 seconds"
    ExpiresByType application/x-javascript "access plus 216000 seconds"
  &lt;/ifModule&gt;
  </code></pre>
  
  <p>i've translated this part</p>
  
  <pre><code>RewriteEngine On
  RewriteBase /mysite
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ /mysite/index.php/$1 [L]
  </code></pre>
  
  <p>that looks like</p>
  
  <pre><code>if (!-f $request_filename){
    set $rule_0 1$rule_0;
  }
  if (!-d $request_filename){
    set $rule_0 2$rule_0;
  }
  if ($rule_0 = "21"){
    rewrite ^/(.*)$ /mysite/index.php/$1 last;
  }
  </code></pre>
  
  <p>is it ok?</p>
  
  <p>Then I need to translate the second part of the htaccess (showed above).</p>
  
  <p>How can I translate that?</p>