title: nginx and memcached, returns "download" as an attachment and not html content
body: <p>I've got nginx set up to serve html content straight from memcached but to fail over to PHP using our own backend (not a traditional set up hence the configuration) but whenever a page is set in PHP to be retrieved from memcached, nginx appears to find it but then just downloads a file called "download" with what looks like binary data inside.</p>
  
  <p>this is the nginx.conf file, and it's built from source using enhanced memcached module.</p>
  
  <pre><code>worker_processes  1;
  
  events {
      worker_connections  1024;
  }
  
  http {
  
      include /usr/local/nginx/conf/mime.types;
      default_type application/octet-stream;
  
      server {
          listen 80;
          server_name localhost;
          location / {
                  root /var/www;
                  index index.html;
          }
          location ~* \.php$ {
                  root /var/www;
                  fastcgi_pass 127.0.0.1:9000;
                  fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                  fastcgi_param PATH_INFO $fastcgi_script_name;
                  include fastcgi_params;
          }
      }
  
      server {
          listen 80;
          server_name mydomain.com;
          access_log /path/to/access/log/access_log;
          error_log /path/to/error/log/error_log;
          root /u1/live/sites/public_html;
  
          location ~* \.(jpg|png|gif|css|js|swf|flv|ico|html|woff|ttf|svg|htm)$ {
                  try_files $uri $uri/ $uri.html @notcached;
          }
  
          location ~* \.php$ {
                  fastcgi_pass 127.0.0.1:9000;
                  fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                  fastcgi_read_timeout 240;
                  include fastcgi_params;
          }
  
          location / {
                  set $enhanced_memcached_key "$server_name$request_uri";
                  enhanced_memcached_hash_keys_with_md5 on;
                  enhanced_memcached_pass memcache.local:11211;
                  error_page 404 = @notcached;
          }
  
          location @memcache {
                  set $enhanced_memcached_key "$server_name$request_uri";
                  enhanced_memcached_hash_keys_with_md5 on;
                  enhanced_memcached_pass memcache.local:11211;
                  error_page 404 = @notcached;
          }
  
          location @notcached {
                  fastcgi_pass 127.0.0.1:9000;
                  fastcgi_param SCRIPT_FILENAME /path/to/main/php/file/index.html;
                  fastcgi_param PATH_INFO $fastcgi_script_name;
                  fastcgi_read_timeout 240;
                  include fastcgi_params;
          }
  
      }
  
  }
  </code></pre>