Alexis Kalderimis
and 1 contributors


Dancer::Plugin::ProxyPath - Provides user-perspective paths


Version 0.03


This module provides an alternative to using request->uri_for, which provides server perspective paths. The paths produced by this module are made using headers provided by Apache to determine what the path should be from the requester's perspective. This is useful when you have deployed your Dancer app using the ReverseProxy method:'s_mod_proxy

Supposing a Dancer app hosted on but reachable at, the following should apply:

    use Dancer::Plugin::ProxyPath;

    my $internal_path = request->uri_for("/path/to/elsewhere");

    my $external_path = proxy->uri_for("/path/to/elsewhere");

    # and in your templates: (assuming a passed variable $background)

    <body style="background-image: url('<% proxy.uri_for(background) %>')">

If no proxy information is found, proxy->uri_for will return the same paths as request->uri_for, making it work in development as well.

If the proxy is not mounted at the root level, you will need to pass along the mounted location, using a header (See README). You can set the name of the header you have chosen with the plugin setting "base_header"


One function is exported by default: proxy



Returns the proxy object, which has two methods: path and uri_for.

See Dancer::Plugin::ProxyPath::Proxy


Alex Kalderimis, <alex kalderimis at gmail dot com>


Please report any bugs or feature requests to bug-dancer-plugin-proxypath at, or through the web interface at I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.


You can find documentation for this module with the perldoc command.

    perldoc Dancer::Plugin::ProxyPath

You can also look for information at:


Dancer obviously, for being a great way to write a web-app.


Copyright 2011 Alex Kalderimis.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See for more information.