get the current hostname behind a mod_proxy installation

24 views
Skip to first unread message

Manuele Pesenti

unread,
Sep 9, 2020, 10:36:38 AM9/9/20
to web2py-users
Hi!!
Behind a mod_proxy apache virtual host how can I get within the server
side code witch hostname has been currently called? Considering at the
moment I have configured one hostname and more than one aliases I'd like
not to write the hostname directly ion the code.

Thanks a lot!

    Manuele

Clemens

unread,
Sep 9, 2020, 10:44:29 AM9/9/20
to web2py-users
Does request.env.http_host gives us the information you want?

Manuele Pesenti

unread,
Sep 10, 2020, 2:48:48 AM9/10/20
to web...@googlegroups.com

Actually I used request.env.HTTP_X_FORWARDED_SERVER I really don't know if your answer fits anyway.

Thanks!

    Manuele

Reply all
Reply to author
Forward
0 new messages