Last active
January 27, 2021 20:35
-
-
Save ebouchut/1939752 to your computer and use it in GitHub Desktop.
Revisions
-
ebouchut revised this gist
Apr 25, 2019 . No changes.There are no files selected for viewing
-
ebouchut created this gist
Feb 29, 2012 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,43 @@ #server.modules += ( "mod_rewrite") # Workaround to have a working reverse-proxy that matches an URL does URL rewriting in Ligghtpd. # # Ligtthpd 1.4.28 cannot perform both matching and URL rewriting at the same time. # Therefore we need to define 2 proxies, one does the matching and bounce the request # to the other one, in charge of rewriting the URL before proxying the request to the target server. # # More about this here: # http://redmine.lighttpd.net/issues/164#note-9 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # $HTTP["url"] =~ /servername/path # => 127.0.0.1:82 (rewrite : remove "/servername") # => servername:80/path #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Matching Proxy # $HTTP["url"] =~ "(^/servername/)" { proxy.server = ( "" => ( "servername:80" => # name ( "host" => "127.0.0.1", "port" => 82 ) ) ) } # URL Rewriting Proxy # $SERVER["socket"] == ":82" { url.rewrite-once = ( "^/servername/(.*)$" => "/$1" ) proxy.server = ( "" => ( "servername:82" => # name ( "host" => "10.0.0.1", # Set the IP address of servername "port" => 80 ) ) ) }