Skip to content
Snippets Groups Projects
Commit 2d8c2737 authored by Xavier Morel's avatar Xavier Morel
Browse files

[MERGE] support running a standalone OpenERP Web instance behind a trivially...

[MERGE] support running a standalone OpenERP Web instance behind a trivially configured reverse proxy

bzr revid: xmo@openerp.com-20110922150051-xdmar5ahck8pcn26
parents 1edacff4 34d7b061
Branches
Tags
No related merge requests found
......@@ -7,6 +7,7 @@ import logging
import logging.config
import werkzeug.serving
import werkzeug.contrib.fixers
path_root = os.path.dirname(os.path.abspath(__file__))
path_addons = os.path.join(path_root, 'addons')
......@@ -40,6 +41,9 @@ optparser.add_option("--log-config", dest="log_config",
optparser.add_option('--multi-threaded', dest='threaded',
default=False, action='store_true',
help="Use multiple threads to handle requests")
optparser.add_option('--proxy-mode', dest='proxy_mode',
default=False, action='store_true',
help="Enable correct behavior when behind a reverse Proxy")
import web.common.dispatch
......@@ -56,6 +60,9 @@ if __name__ == "__main__":
app = web.common.dispatch.Root(options)
if options.proxy_mode:
app = werkzeug.contrib.fixers.ProxyFix(app)
werkzeug.serving.run_simple(
'0.0.0.0', options.socket_port, app,
use_reloader=options.reloader, threaded=options.threaded)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment