Skip to content

Commit 82b6e8f

Browse files
authored
Merge pull request #118 from HarryKodden/main
make RP aware of running behind ssl terminating front end proxy
2 parents 2335ecd + 1530688 commit 82b6e8f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Diff for: example/flask_rp/wsgi.py

+6
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
from idpyoidc.configure import create_from_config_file
99
from idpyoidc.ssl_context import create_context
1010

11+
from werkzeug.middleware.proxy_fix import ProxyFix
12+
1113
try:
1214
from . import application
1315
except ImportError:
@@ -25,6 +27,10 @@
2527
filename=conf)
2628

2729
app = application.oidc_provider_init_app(_config.rp, name, template_folder=template_dir)
30+
31+
app.wsgi_app = ProxyFix(app.wsgi_app, x_for=1, x_proto=1, x_host=1, x_port=1, x_prefix=1)
32+
33+
2834
_web_conf = _config.web_conf
2935
context = create_context(dir_path, _web_conf)
3036

0 commit comments

Comments
 (0)