如何在Apache HTTPS代理背后配置金字塔应用程序

如何在Apache HTTPS代理背后配置金字塔应用程序,https,mod-wsgi,pyramid,proxypass,Https,Mod Wsgi,Pyramid,Proxypass,我有一个使用mod_wsgi-express在内部服务器上运行的金字塔应用程序。地址是 我想使用代理和SSL使其在外部可用。因此,我有以下Apache配置: <VirtualHost *:443> ServerName myapp.org ProxyRequests Off ProxyPreserveHost On # proxy pass /myapp to the internal:6543/myapp ProxyPass

我有一个使用mod_wsgi-express在内部服务器上运行的金字塔应用程序。地址是

我想使用代理和SSL使其在外部可用。因此,我有以下Apache配置:

<VirtualHost *:443>

    ServerName myapp.org

    ProxyRequests Off
    ProxyPreserveHost On

    # proxy pass /myapp to the internal:6543/myapp
    ProxyPass           /myapp       http://172.31.15.111:6543/myapp/
    ProxyPassReverse    /myapp       http://172.31.15.111:6543/myapp/

    <Proxy *>
        allow from all
    </Proxy>
    ProxyTimeout 1200


</VirtualHost>
[server:main]
use = egg:waitress#main
listen = localhost:6543
我也试过:

[server:main]
use = egg:waitress#main
#listen = localhost:6543
host = 172.31.15.111
port = 6543
url_scheme = https
我还尝试在apache中使用请求头:

RequestHeader set X-Forwarded-Port 443
    RequestHeader set X-Forwarded-Scheme https

但我得到了同样的结果。非常感谢您提供任何解决方案。

对于背景阅读,我们在中讨论了代理到mod_wsgi-express,但忽略了它谈到的Docker,仍然适用。我看了一下,并尝试了“RequestHeader set X-Forwarded-Port 443”和“RequestHeader set X-Forwarded-Scheme https”但我得到了同样的结果。嗨,格雷厄姆·邓普尔顿。我根据你的链接修复了它。我错过的是mod_wsgi-express设置中的--trust proxy头。非常感谢你的帮助