title: Django application works under runserver, but 404s under nginx
body: <p>My Django app is running fine on my server when running it under "python manage.py runserver....." but when I run it under nginx/fastcgi I get a 404.</p>
  
  <p>Here is the error message:</p>
  
  <blockquote>
    <p>Page not found (404)<br>
    Request Method:   GET<br>
    Request URL:  blah.youtrain.me/admin/ (I removed the http due to StackOverflow constraints for new account)<br>
    <br>
    Using the URLconf defined in youtrainme.urls, Django tried these URL patterns, in this order:<br>
    <br>
    ^admin/doc/<br>
    ^admin/
    <br>
    The current URL, , didn't match any of these.<br></p>
  </blockquote>
  
  <p>No matter what page on my app I go to under nginx, it always displays the same error message: "The current URL, , didn't match any of these."</p>
  
  <p>Under nginx, if I just go to blah.youtrain.me the Request URL above changes to: blah.youtrain.me// &lt;--- note the trailing slash. However, under runserver, there is no trailing slash in the Request URL line. This might give some insight?</p>
  
  <p>Any help would be greatly appreciated! :)</p>
  
  <p>Here is my nginx config for this site:</p>
  
  <blockquote>
    <p>server<br>
        {<br>
        listen 80;<br>
        server_name blah.youtrain.me;<br>
        access_log /home/ytmadmin/public_html/blah.youtrain.me/log/access.log;<br>
        error_log /home/ytmadmin/public_html/blah.youtrain.me/log/error.log debug;<br>
        # rewrite rule - files<br>
        location ~* .+.>(xml|jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js|swf)<br>
            {<br>
            access_log off;<br>
      expires 30d;<br>
            break;<br>
            }<br>
        # python requests<br>
        location /<br>
            {<br>
            fastcgi_pass 127.0.0.1:8010;<br>
            fastcgi_pass_header Authorization;<br>
      fastcgi_intercept_errors off;<br>
      include /usr/local/nginx/conf/fastcgi_params;<br>
            }<br>
    }<br></p>
  </blockquote>
  
  <p>And my urls.py</p>
  
  <blockquote>
    <p>from django.conf.urls.defaults import patterns, include, url<br>
    <br>
    from django.contrib import admin<br>
    admin.autodiscover()<br>
    <br>
    urlpatterns = patterns('',<br>
        (r'^$', 'main.views.index'),<br>
        (r'^admin/doc/', include('django.contrib.admindocs.urls')),<br>
    <br>
        # Uncomment the next line to enable the admin:<br>
        (r'^admin/', include(admin.site.urls)),<br>
    )<br></p>
  </blockquote>