title: How to Handle Incomplete Django/Nginx File Server URLs?
body: <p>I have a Django website that uses Nginx on a separate file server to serve up images uploaded by my users.  When any user views another user's photos, the link to the photo will have this structure:</p>
  
  <pre><code>https://fs01.mysite.com/media/photos/&lt;username&gt;_&lt;photo-id&gt;.jpg
  </code></pre>
  
  <p>When the page is rendered, the user's photo is served up by the file server (fs).  But what is the Nginx way of handling incomplete (one could also say incorrect) requests to subdirectories of the above URL?  For example, if a user enters this URL:</p>
  
  <pre><code>https://fs01.mysite.com
  </code></pre>
  
  <p>...they see Nginx's default "Welcome to nginx on ..." page.  If they enter this URL:</p>
  
  <pre><code>https://fs01.mysite.com/media
  </code></pre>
  
  <p>...they'll get the Nginx "404 Not Found" page.  And if they enter this URL:</p>
  
  <pre><code>https://fs01.mysite.com/media/photos
  </code></pre>
  
  <p>...they'll get the Nginx "403 Forbidden" page.</p>
  
  <p>How do you handle these situations in Nginx?</p>