Home

ProxyPassReverse

ProxyPassReverse is a directive in the Apache HTTP Server, part of the mod_proxy module, used in reverse proxy configurations to rewrite certain response headers so that the client sees URLs tied to the proxy rather than the backend server. It does not alter the request sent to the backend, only the response returned to the client.

In operation, when a proxied backend returns a redirect or a resource URL that points to its

Syntax and usage are short and straightforward. The typical form is per mapping: ProxyPassReverse [path] URL.

ProxyPass /app http://backend.example.com/app

ProxyPassReverse /app http://backend.example.com/app

or

ProxyPass / http://backend.example.local/

ProxyPassReverse / http://backend.example.local/

Headers affected are primarily Location and Content-Location, which carry absolute URLs, but the directive may be

Use of ProxyPassReverse is recommended whenever a reverse proxy forwards requests to a backend server that

own
host,
ProxyPassReverse
rewrites
those
header
values
to
reflect
the
proxy’s
public
URL
space.
This
helps
preserve
a
consistent
URL
experience
for
clients
and
prevents
exposure
of
internal
hostnames.
For
example:
extended
with
related
cookie
directives
if
needed.
Related
directives
include
ProxyPassReverseCookiePath
and
ProxyPassReverseCookieDomain,
which
adjust
cookie
paths
and
domains
in
responses
from
the
backend.
generates
absolute
URLs
in
its
responses.
It
ensures
that
clients
interact
with
URLs
that
map
to
the
proxy
rather
than
to
the
backend,
maintaining
proper
navigation
and
redirection
across
the
proxy
boundary.