title: Nginx always returns html of main page instead of JSON data
body: <p>I am newbie in nginx and web server technologies.
  I have a django project and I am trying to use nginx + fastCGI on web server.</p>
  
  <p>In my project I have urls which returns html and urls which returns JSON data.
  When I tries to get JSON data nginx server always(no errors, no warnings) returns html from the main page.
  Content type of response is "text/html", but should be "application/json".</p>
  
  <p>There is my nginx configuration(This file is almost  default settings):</p>
  
  <pre><code>user www-data;
  worker_processes 4;
  pid /var/run/nginx.pid;
  
  events {
          worker_connections 768;
  }
  
  http {
  
          ##
          # Basic Settings
          ##
  
          sendfile on;
          tcp_nopush on;
          tcp_nodelay on;
          keepalive_timeout 65;
          types_hash_max_size 2048;
  
          include /etc/nginx/mime.types;
          default_type application/octet-stream;
  
          server{
                  listen 8080;
  
                  location / {
                          fastcgi_pass 127.0.0.1:8881; 
                          include fastcgi_params;
                  }
  
                  location /static {
                          alias /home/user/xxx/templates;
                  }
          }
  
          access_log /var/log/nginx/access.log;
          error_log /var/log/nginx/error.log;
  
          gzip on;
          gzip_disable "msie6";
  
          gzip_comp_level 6;
          gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
  }
  </code></pre>
  
  <p>I've tried to set up Apache with mod_python and I've got successful result.
  What I am doing wrong? How should I properly configure nginx for getting JSON data?
  Please ask me if you need more information.</p>
  
  <p>Thanks in advance.</p>