class ScriptNameStripper(object):

    def __init__(self, app):
        self.app = app

def __call__(self, environ, start_response):
    environ['SCRIPT_NAME'] = ''
return self.app(environ, start_response)
app = ScriptNameStripper(app)
try:
    CGIHandler().run(app)
except Exception as e:
    LGGR.info(traceback.format_exc([10]))
LGGR.info('Problem in cgiappserver-prod with CGIHandler().run(): %s' % e)
Deploy flask application on 1&1 shared hosting (with CGI)