title: Nginx 404 error on every page with magento (except front page)
body: <p>i am breaking my head over this.
  I have <code>magento 1.8.1</code> and migrating this to a nginx server (from apache)</p>
  
  <p>The main page does work, but when i try to go to a other page (like a category or product page) i get a 404 error from Nginx.
  I can't get this solved.</p>
  
  <p>I have php-fpm installed and running.</p>
  
  <pre><code>nginx version: nginx/1.1.19
  </code></pre>
  
  <p>and</p>
  
  <pre><code>PHP 5.3.10-1ubuntu3.12 (fpm-fcgi) (built: Jun 20 2014 00:40:17)
  Copyright (c) 1997-2009 The PHP Group
  Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies
      with the ionCube PHP Loader v4.2.2, Copyright (c) 2002-2012, by ionCube Ltd.
  </code></pre>
  
  <p>My <code>nginx.conf</code>:</p>
  
  <pre><code>user www-data;
  worker_processes 4;
  pid /var/run/nginx.pid;
  events {
  worker_connections 1024;
  }
  http {
  ##
  # Basic Settings
  ##
  server_tokens off;
  sendfile on;
  keepalive_timeout 5;
  types_hash_max_size 2048;
  include /etc/nginx/mime.types;
  default_type application/octet-stream;
  map $scheme $fastcgi_https { ## Detect when HTTPS is used
  default off;
  https on;
  }
  ##
  # Logging Settings
  ##
  access_log /var/log/nginx/access.log;
  error_log /var/log/nginx/error.log notice;
  rewrite_log on;
  log_format main ?$remote_addr - $remote_user [$time_local] $request ?
  ??$status? $body_bytes_sent ?$http_referer? ?
  ??$http_user_agent? ?$http_x_forwarded_for??;
  ##
  # Gzip Settings
  ##
      gzip  on;
      gzip_comp_level 2;
      gzip_proxied any;
      gzip_types      text/plain text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript;
  
  ##
  # Virtual Host Configs
  ##
  include /etc/nginx/conf.d/*.conf;
  include /etc/nginx/sites-enabled/*;
  }
  </code></pre>
  
  <p>My <code>site.conf</code>:</p>
  
  <pre><code>server {
      listen 80 default_server;
  
  server_name xxx.stratoserver.net www.xxx.stratoserver.net; # like ServerName in Apache
  root /var/www/vhosts/path_to; # document root
  autoindex off; # we don’t want users to see files in directories
  
  #ensure sensitive files are not accessible    
  location ~ (^/(app/\|includes/\|lib/\|/pkginfo/\|var/\|report/config.xml)\|/\.svn/\|/\.git/\|/.hta.+) {
  deny all; }
  
  location / {
          index index.php index.html index.htm;
          try_files $uri $uri/ @handler; ## If missing pass the URI to Magento's front handler
          expires 30d; ## Assume all files are cachable
  if ($request_filename ~* ^.*?/([^/]*?)$)
              {
                  set $filename $1; 
              }
  
              if ($filename ~* ^.*?\.(eot)|(ttf)|(woff)$){
                  add_header Access-Control-Allow-Origin *;
              }
  
      }
  
  location ~* \.(jpg|jpeg|gif|png|css|js|ico|xml)$ {
      access_log        off;
      log_not_found     off;
      expires           360d;
  }
  
  
  
    location ~* .php$ {
      if (!-e $request_filename) { rewrite / /index.php last; }
      expires off;
      fastcgi_pass 127.0.0.1:9000;
      fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    #  fastcgi_param MAGE_RUN_CODE default;
      fastcgi_param MAGE_RUN_TYPE store;
      include fastcgi_params;
  }
  
  }
  </code></pre>
  
  <p>Who can help me to get the rest of the website running.
  The <code>phpinfo.php</code> file does work.</p>