10.8. Requiring Authentication for a Proxied Server
Problem
You wish to proxy content from a server, but it requires a login and password before content may be served from this proxied site.
Solution
Use standard authentication techniques to require logins for proxied content:
ProxyPass "/secretserver/" "http://127.0.0.1:8080"
<Directory "proxy:http://127.0.0.1:8080/">
AuthName SecretServer
AuthType Basic
AuthUserFile /path/to/secretserver.htpasswd
Require valid-user
</Directory>Discussion
This technique can be useful if you are running some sort of
special-purpose or limited-function Web server on your system, but you
need to apply Apache’s rich set of access control and its other
features to access it. This is done by using the ProxyPass directive to make the
special-purpose server’s URI space part of your main server, and using
the special proxy:path
<Directory> container syntax
to apply Apache settings only to the mapped URIs.
See Also
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access