Hello,
I am trying to set a custom header through a mod_perl handler.
My perl handler code is:
sub handler {
my $r = shift;
$r->headers_out->add("foo" => "bar");
$r->log->error($r->connection->remote_ip()." is client IP");
return Apache2::Const::OK;
}
The handler gets called as I am able to see the log message, but the header
is not emitted.
My Apache configuration is -
ProxyRequests On
ProxyVia On
ProxyRemote * http://localhost:3128
SetHandler modperl
PerlPostReadRequestHandler +Foo::Proxy
<Location />
ProxyPass http://www.something.com/
ProxyPassReverse http://www.something.com/
</Location>
When I do the same through mod_header like this it works -
RequestHeader set foo bar
I want foo: bar to go as a header in the HTTP request to my proxy on port
3128.
Can anyone advise why my perl handler doesn't work when it should be doing
the same thing as mod_headers?
Regards,
Ashish
I am trying to set a custom header through a mod_perl handler.
My perl handler code is:
sub handler {
my $r = shift;
$r->headers_out->add("foo" => "bar");
$r->log->error($r->connection->remote_ip()." is client IP");
return Apache2::Const::OK;
}
The handler gets called as I am able to see the log message, but the header
is not emitted.
My Apache configuration is -
ProxyRequests On
ProxyVia On
ProxyRemote * http://localhost:3128
SetHandler modperl
PerlPostReadRequestHandler +Foo::Proxy
<Location />
ProxyPass http://www.something.com/
ProxyPassReverse http://www.something.com/
</Location>
When I do the same through mod_header like this it works -
RequestHeader set foo bar
I want foo: bar to go as a header in the HTTP request to my proxy on port
3128.
Can anyone advise why my perl handler doesn't work when it should be doing
the same thing as mod_headers?
Regards,
Ashish