title: uWSGI: how to serve static files from root and an app from a sub directory?
body: <p>I am using Cloud 9 IDE to build a website.  My goal is to serve a static website from the site root '/index.html' and so on.  The content in this site will be regenerated on a schedule (daily in this example).  At the '/admin' and '/api' endpoints I want to serve a couple of flask apps.</p>
  
  <p>Because this is being built on the Cloud 9 IDE, I do not have access to the proxy server configuration.  I have to serve everything to one port using the HTML protocol.  uWSGI is capable of doing exactly this.  I am struggling with my configuration file though:</p>
  
  <pre><code>#uwsgi.ini
  [uwsgi]
  static-index = index.html
  static-map2 = /=/home/ubuntu/workspace/generated-site
  static-map2 = /static=/home/ubuntu/workspace/static-assets
  
  mount = /admin=admin.py
  mount = /api=api.py
  manage-script-name = true
  
  master = true
  processes = 5
  
  socket=0.0.0.0:8080 
  protocol=http
  </code></pre>
  
  <p>Requests to <code>/admin</code> and <code>/api</code> work as expected returning a result or 404 error.</p>
  
  <p>Requests to <code>/</code> and <code>/index.html</code> both return <code>generated-site/index.html</code> as expected.
  A request to <code>/no_exist.html</code> returns <code>404 Not Found</code> as expected.</p>
  
  <p>My problem is with the second <code>static-map2</code>.  A request to <code>/static/test.html</code> came back <code>404 Not Found</code> (I put an html file there to test).</p>