<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPreserveHost On
<Location "/myapp">
ProxyPass "http://127.0.0.1:4000/myapp/"
ProxyPassReverse "http://127.0.0.1:4000/myapp/"
</Location>
Reference http://flask.pocoo.org/snippets/84/
class CherrokeeFix(object):
def __init__(self, app, script_name):
self.app = app
self.script_name = script_name
def __call__(self, environ, start_response):
path = environ.get('SCRIPT_NAME', '') + environ.get('PATH_INFO', '')
environ['SCRIPT_NAME'] = self.script_name
environ['PATH_INFO'] = path[len(self.script_name):]
# assert path[:len(self.script_name)] == self.script_name
return self.app(environ, start_response)
And then
app = Flask(__name__)
app.wsgi_app = CherrokeeFix(app.wsgi_app, '/myapp')