Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Apache proxies to a PSGI application using HTTP::Server::PSGI.

apache conf file:

<Proxy balancer://my_cluster>

ProxyPreserveHost On
ProxyPass /dispatch/ balancer://my_cluster/

The url is going to be:

after calling $self->query->self_url() I get:

/dispatch is cut out every time. I'm not sure what layer is cutting it out or how to get it back.

share|improve this question
Does your PSGI app use the ReverseProxy middleware? – hobbs May 26 '11 at 20:59
No. Should it? (15 char comment min?) – nathand May 26 '11 at 21:19
turned out to be a red herring, per discussion in #plack. Ideally, Middleware::ReverseProxy would help with this, but there's no "forwarded path" information, so it actually doesn't :) – hobbs May 26 '11 at 21:23
up vote 2 down vote accepted

First I needed to set ProxyPreserveHost Off (which is the default)

Change the entry point for the PSGI app.

builder {
   return $app;


builder {
   mount "/dispatch" => $app

change the ProxyPass to:

ProxyPass /dispatch/ balancer://my_cluster/dispatch/

Now url_self() works as expected.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.