Skip to content

Instantly share code, notes, and snippets.

@caspian311
Last active August 29, 2015 14:05
Show Gist options
  • Select an option

  • Save caspian311/edb437ac8c1ef8a031ae to your computer and use it in GitHub Desktop.

Select an option

Save caspian311/edb437ac8c1ef8a031ae to your computer and use it in GitHub Desktop.
pass along an HTTP header containing the logged-in username for authenticated requests to backend reverse proxied services
LoadModule auth_kerb_module modules/mod_auth_kerb.so
LoadModule rewrite_module modules/mod_rewrite.so
<Location /services>
AuthType Kerberos
AuthName "Kerberos Login"
KrbMethodNegotiate On
KrbMethodK5Passwd On
KrbAuthRealms <DOMAIN-NAME>
Krb5KeyTab /etc/krb5.keytab
require valid-user
KrbVerifyKDC off
RewriteEngine On
RewriteCond %{LA-U:REMOTE_USER} (.+)
RewriteRule . - [E=RU:%1,NS]
RequestHeader set X-Remote-User "%{RU}e" env=RU
</Location>
LoadModule proxy_module modules/mod_proxy.so
ProxyRequests Off
ProxyPass /services/ http://<remove-server>/services/
<Location /services>
ProxyPassReverse /services
</Location>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment