forked from HXLStandard/hxl-proxy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
hxl-proxy.wsgi.TEMPLATE
53 lines (38 loc) · 1.38 KB
/
hxl-proxy.wsgi.TEMPLATE
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
"""
Apache WSGI file for launching HXL Proxy
David Megginson
February 2015
License: Public Domain
Documentation: http://hxlstandard.org
Assumes that hxl_proxy is installed as an app. If running locally, add
the directory containing the hxl_proxy module to sys.path.
"""
import sys
import os
# If you want to run in a virtualenv (recommended), then uncomment the
# following two lines, and set the value to the appropriate path
#activate_this = '/path/to/virtualenv/bin/activate_this.py'
#execfile(activate_this, dict(__file__=activate_this))
# If you are running from a source distribution, uncomment the
# following line and set to the root of the distro
#sys.path.insert(0, '/srv/www/hxl-proxy/')
# Set config file location
# (set to the location of your custom config.py)
os.environ['HXL_PROXY_CONFIG'] = '/path/config.py'
#
# Run ...
#
from hxl_proxy import app as application
# run it under a different url path than /
# 1. configure nginx
# location ^~ /myprefix {
# proxy_pass http://<hxl_proxy_ip>:<hxl_proxy_port>;
# proxy_set_header Host $host;
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# proxy_set_header X-Scheme $scheme;
# proxy_set_header X-Script-Name /myprefix;
# }
# 2. uncomment the 2 lines below
#from <path_to_reverse_proxied.py> import reverse_proxied as rp
#application.wsgi_app = rp.ReverseProxied(application.wsgi_app)
# end