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>
ServerName domain.com
ProxyPreserveHost On
ProxyPass /
ProxyPassReverse /
Redirect permanent / https://www.domain.com/

Open in new window

Please advise.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

GEMCCAuthor Commented:
I don't understand.
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.
GEMCCAuthor Commented:
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)
Your Guide to Achieving IT Business Success

The IT Service Excellence Tool Kit has best practices to keep your clients happy and business booming. Inside, you’ll find everything you need to increase client satisfaction and retention, become more competitive, and increase your overall success.

Here are some lighttpd how tos http://redmine.lighttpd.net/projects/lighttpd/wiki/HowTos

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>
serverName domain.com
Sslengine on
Cert .........
the proxying portion examples including reverse-proxy are referenced on http://redmine.lighttpd.net/projects/1/wiki/Docs_ModProxyCore
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.
GEMCCAuthor Commented:
I am still not understanding.  I put the following in lighttpd.conf:

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

Open in new window

If I understand domain.com should go to, correct?
the example in the link for reverse-proxy

Is and presumes you've enabled the required mod_proxy...
Snippet from http://redmine.lighttpd.net/projects/1/wiki/Docs_ModProxyCore

  server.modules  += ( "mod_proxy_backend_http" )
  $HTTP["url"] =~ "^(/|$)" {
    proxy-core.balancer = "round-robin" 
    proxy-core.protocol = "http" 
    proxy-core.backends = ( "www.domain.com" )
    proxy-core.rewrite-response = (
      "Location" => ( "^http://www.domain.com/(.*)" => "$1" ),
    proxy-core.rewrite-request = (
      "_uri" => ( "^/proxyme/?(.*)" => "/$1" ),
      "Host" => ( ".*" => "www.domain.com ),

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
GEMCCAuthor Commented:
Thank you.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Apache Web Server

From novice to tech pro — start learning today.