title: running Flask jQuery example under Apache proxy
body: <p>I can successfully run the <a href="http://github.com/mitsuhiko/flask/tree/master/examples/jqueryexample" rel="nofollow">Flask jQuery example</a> (as referred near bottom of <a href="http://flask.pocoo.org/docs/patterns/jquery" rel="nofollow">Flask's "AJAX with jQuery"</a> page.) It runs on the flask development server, and is accessible at <code>http://localhost:5000</code>. </p>
  
  <p>How do I proxy the page so that I can access the same app under <code>http://localhost/jqueryexample</code>?</p>
  
  <p>I added this to my Apache VirtualHost entry thinking it will do the trick:</p>
  
  <pre><code>ProxyPass /jqueryexample http://localhost:5000/
  ProxyPassReverse /jqueryexample http://localhost:5000/
  </code></pre>
  
  <p>But the new URL gives the 404 error:</p>
  
  <pre><code>GET http://localhost/_add_numbers?a=6&amp;b=2 404 (Not Found)
  </code></pre>
  
  <p>How can I get the example to run correctly under "canonical URL" (not sure if that's the right terminology)? Or, how to change the app or Apache configuration in order to get this jQuery example running for both URLs?</p>
  
  <hr>
  
  <p>BTW, here's how you download and run the vanilla <a href="http://github.com/mitsuhiko/flask/tree/master/examples/jqueryexample" rel="nofollow">Flask jQuery example</a> in question:</p>
  
  <pre><code>git clone http://github.com/mitsuhiko/flask 
  cd flask/examples/jqueryexample/ 
  python jqueryexample.py
  </code></pre>