title: flask hosted via lighttpd fastcgi returns 404's for mutlilevel paths
body: <p>I have my flask application up and running in lighttpd using fastcgi, and it works well except all of my multi-level (e.g., <code>/foo/page2</code>) paths result in 404 errors, but the single-level paths work fine (e.g., /page1).</p>
  <blockquote>
  <p>127.0.0.1 localhost:5080 - [06/Sep/2017:16:38:45 +0000] &quot;GET /page1 HTTP/1.1&quot; 200</p>
  <p>127.0.0.1 localhost:5080 - [06/Sep/2017:16:39:07 +0000] &quot;GET /foo/page2 HTTP/1.1&quot; 404</p>
  </blockquote>
  <p>I get flask's 404 error handler, and not lighttpd's.</p>
  <p>When running the application via <code>flask run</code> the multilevel paths work fine.</p>
  <blockquote>
  <p>127.0.0.1 - - [06/Sep/2017 11:44:56] &quot;GET /page1 HTTP/1.1&quot; 200</p>
  <p>127.0.0.1 - - [06/Sep/2017 11:44:56] &quot;GET /foo/page2 HTTP/1.1&quot; 200</p>
  </blockquote>
  <p>My <code>lighttpd.conf</code> looks like:</p>
  <pre><code>server.document-root = &quot;/var/www/&quot;
  
  server.port = 5080
  server.username = &quot;foobar&quot;
  server.groupname = &quot;foobar&quot;
  
  server.modules += (
      &quot;mod_fastcgi&quot;,
      &quot;mod_rewrite&quot;,
      &quot;mod_alias&quot;,
      &quot;mod_accesslog&quot;
  )
  
  $HTTP[&quot;url&quot;] !~ &quot;^/static&quot; {
      fastcgi.server = (&quot;/&quot; =&gt;
          ((
              &quot;socket&quot; =&gt; &quot;/tmp/foobar-fcgi.sock&quot;,
              &quot;bin-path&quot; =&gt; &quot;/home/foobar/app.fcgi&quot;,
              &quot;check-local&quot; =&gt; &quot;disable&quot;,
              &quot;max-procs&quot; =&gt; 1
          ))
      )
  }
  
  # give us debugging output
  fastcgi.debug = 1
  
  alias.url = (
      &quot;/static&quot; =&gt; &quot;/var/www/static&quot;
  )
  </code></pre>
  <p>My routes look like:</p>
  <pre><code>PAGE = Blueprint(&quot;home&quot;, __name__)
  
  @PAGE.route(&quot;/page1&quot;, methods=[&quot;GET&quot;])
  def page1_view():
      ...
  
  @PAGE.route(&quot;/foo/page2&quot;, methods=[&quot;GET&quot;])
  def page2_view():
      ...
  </code></pre>
  <p>And finally the blue print registering:</p>
  <pre><code>app = Flask(__name__)
  
  app.register_blueprint(PAGE)
  </code></pre>