Example With a Lighttpd Server - AFS

AFS Integration Guide

Product
AFS
AFS_Version
7.7
Category
Reference Guide

Create a new configuration file for your Lighttpd server under /etc/lighttpd/conf-available containing:

server.modules += ( "mod_rewrite")

##
### Lighttpd reverse-proxy workaround
##

# http://redmine.lighttpd.net/issues/164#note-9

$HTTP["url"] =~ "(^/foo/)" {
proxy.server = ( "" => (
"foo:80" => (
"host" => "127.0.0.1",
"port" => 81
)
)
)
}
$SERVER["socket"] == ":81" {
url.rewrite-once = ( "^/foo/(.*)$" => "/$1" )
proxy.server = ( "" => (
"foo:81" => (
"host" => "FOO.SERVER.IP.ADRESS",
"port" => 80
)
)
)
}

This reverse proxy configuration redirects requests on http://localhost/foo/search to http://FOO.SERVER.IP.ADRESS.

Replace foo with the distant domain and restart your web server.

  • Enable the created module:

enable-mod <yourmodulename>

  • Restart the Lighttpd to take changes into account:

/etc/init.d/lighttpd restart