Link to home
Create AccountLog in
Avatar of GEMCC

asked on

Apache to Lighttpd


I have Apache running on an existing Linux server and am in the process of replacing.  How do I translate/convert the following from Apache to Lighttpd:

<VirtualHost *:80>
ProxyPreserveHost On
ProxyPass /
ProxyPassReverse /
Redirect permanent /

Open in new window

Please advise.
Avatar of GEMCC


I don't understand.
Avatar of arnold
Have ltried searching for "Lighthttpd as a reverse proxy"
There are many examples.

Squid might be a better option,  

you are defining a proxy YET YOU ARE REDIRECTING all requests to a secure connection.

Dies the application behind the reverse proxy hard odes the ip from the request, I.e. Access by way of means the app response includes that as base href/or complete URL reference in the objects within as the reason for the URL conversions.
Avatar of GEMCC


I regret you are talking over my head.

Maybe this is better:

I am using a router that has Lighttpd installed.  I am wanting to direct URL requests to go to various servers.  Some will have different port numbers and some will redirect to HTTPS (for example)
Here are some lighttpd how tos

The virtualhost for port 80 you posted is a straight redirect.
There is no need to include proxy parameters.
From the refirect example in the lighttpd
$HTTP["scheme"] == "http" {
    # capture vhost name with regex conditiona -> %0 in redirect pattern
    # must be the most inner block to the redirect rule
    $HTTP["host"] =~ ".*" {
        url.redirect = (".*" => "https://%0$0")

You would want the proxy configuration on the secure, 443 port, in your Apache config those are under the /etc/httpd/conf.d
DSL.conf or you gave a domain.conf that includes the
<virtualhost *:443>
Sslengine on
Cert .........
the proxying portion examples including reverse-proxy are referenced on
Note, you need to apply the proxying on https not http.
My advice is that you test one at a time, first configure the redirect and test it first.
Avatar of GEMCC


I am still not understanding.  I put the following in lighttpd.conf:

$HTTP["host"] =~ "(" {
        proxy.server = ( "" => ( (
                "host" => "",
                "port" => 80

Open in new window

If I understand should go to, correct?
Avatar of arnold
Flag of United States of America image

Link to home
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of GEMCC


Thank you.