Get the Host that I am running under
Hi, I am currently fetching the host my application is running under by fetching $ENV{HTTP_HOST} inside a route handler. Very soon, I plan to host this behind Apache with mod_proxy. How can I get the hostname of the proxy when that happens? Thanks
$ENV{HTTP_HOST} should be equal to the value, provided by "Host: " Request Header field. I think you should check out documentation about passing this value to the backend (ProxyPreserveHost directive) http://httpd.apache.org/docs/2.0/mod/mod_proxy.html#proxypreservehost 24.06.2011 17:43, Gurunandan Bhat ?????:
Hi,
I am currently fetching the host my application is running under by fetching $ENV{HTTP_HOST} inside a route handler. Very soon, I plan to host this behind Apache with mod_proxy.
How can I get the hostname of the proxy when that happens?
Thanks
_______________________________________________ Dancer-users mailing list Dancer-users@perldancer.org http://www.backup-manager.org/cgi-bin/listinfo/dancer-users
On 24/06/2011 14:50, Maxim Nikolenko wrote:
$ENV{HTTP_HOST} should be equal to the value, provided by "Host: " Request Header field.
I think you should check out documentation about passing this value to the backend (ProxyPreserveHost directive)
http://httpd.apache.org/docs/2.0/mod/mod_proxy.html#proxypreservehost
You might look to behind_proxy configuration variable as well...
24.06.2011 17:43, Gurunandan Bhat пишет:
Hi,
I am currently fetching the host my application is running under by fetching $ENV{HTTP_HOST} inside a route handler. Very soon, I plan to host this behind Apache with mod_proxy.
How can I get the hostname of the proxy when that happens?
Thanks
_______________________________________________ Dancer-users mailing list Dancer-users@perldancer.org http://www.backup-manager.org/cgi-bin/listinfo/dancer-users
_______________________________________________ Dancer-users mailing list Dancer-users@perldancer.org http://www.backup-manager.org/cgi-bin/listinfo/dancer-users
Thank you. On Fri, Jun 24, 2011 at 7:20 PM, Maxim Nikolenko <root@zbsd.ru> wrote:
** $ENV{HTTP_HOST} should be equal to the value, provided by "Host: " Request Header field.
I think you should check out documentation about passing this value to the backend (ProxyPreserveHost directive)
http://httpd.apache.org/docs/2.0/mod/mod_proxy.html#proxypreservehost
24.06.2011 17:43, Gurunandan Bhat пишет:
Hi,
I am currently fetching the host my application is running under by fetching $ENV{HTTP_HOST} inside a route handler. Very soon, I plan to host this behind Apache with mod_proxy.
How can I get the hostname of the proxy when that happens?
Thanks
_______________________________________________ Dancer-users mailing listDancer-users@perldancer.orghttp://www.backup-manager.org/cgi-bin/listinfo/dancer-users
_______________________________________________ Dancer-users mailing list Dancer-users@perldancer.org http://www.backup-manager.org/cgi-bin/listinfo/dancer-users
On 06/24/2011 03:43 PM, Gurunandan Bhat wrote:
Hi,
I am currently fetching the host my application is running under by fetching $ENV{HTTP_HOST} inside a route handler. Very soon, I plan to host this behind Apache with mod_proxy.
How can I get the hostname of the proxy when that happens?
Why do you need the hostname at all? If everything is configured correctly as described in Dancer::Deployment and Dancer::Config (behind_proxy), you can construct URLs for redirects and such with uri_for. Regards Racke -- LinuXia Systems => http://www.linuxia.de/ Expert Interchange Consulting and System Administration ICDEVGROUP => http://www.icdevgroup.org/ Interchange Development Team
I need to send the public facing URL of the application in an email to confirm registration Thanks On Fri, Jun 24, 2011 at 7:23 PM, Stefan Hornburg (Racke) <racke@linuxia.de>wrote:
On 06/24/2011 03:43 PM, Gurunandan Bhat wrote:
Hi,
I am currently fetching the host my application is running under by fetching $ENV{HTTP_HOST} inside a route handler. Very soon, I plan to host this behind Apache with mod_proxy.
How can I get the hostname of the proxy when that happens?
Why do you need the hostname at all?
If everything is configured correctly as described in Dancer::Deployment and Dancer::Config (behind_proxy), you can construct URLs for redirects and such with uri_for.
Regards Racke
-- LinuXia Systems => http://www.linuxia.de/ Expert Interchange Consulting and System Administration ICDEVGROUP => http://www.icdevgroup.org/ Interchange Development Team
______________________________**_________________ Dancer-users mailing list Dancer-users@perldancer.org http://www.backup-manager.org/**cgi-bin/listinfo/dancer-users<http://www.backup-manager.org/cgi-bin/listinfo/dancer-users>
On 06/24/2011 04:00 PM, Gurunandan Bhat wrote:
I need to send the public facing URL of the application in an email to confirm registration
Right, uri_for is your friend for that usecase. Regards Racke -- LinuXia Systems => http://www.linuxia.de/ Expert Interchange Consulting and System Administration ICDEVGROUP => http://www.icdevgroup.org/ Interchange Development Team
participants (4)
-
Alberto Simoes -
Gurunandan Bhat -
Maxim Nikolenko -
Stefan Hornburg (Racke)