Gmane
From: Jan Kneschke <jan <at> kneschke.de>
Subject: Re: New in .11: simplified 'redirect all non-ssl to ssl' and 'proxy to mod_dav_svn'
Newsgroups: gmane.comp.web.lighttpd
Date: 2006-03-07 18:34:44 GMT (3 years, 17 weeks, 12 hours and 37 minutes ago)
On Tue, Mar 07, 2006 at 09:31:51AM -0800, Jack L wrote:
> Hello Jan,
> 
> I'm glad .11 is out. I am trying to understand a few things
> in your email. Please see my questions in-line:
> 
> > $SERVER["socket"] == ":443" {
> >   ssl.engine = "enable"
> >   ssl.pemfile = "/path/to/example.org.pem"
> >   server.document-root = "..."
> > }
> 
> > Yes, this worked already before as long as you havn't specified
> > server.port = 80
> 
> What is the right way of specifying port 80 in this case? When
> I just took a look at my conf file, and I didn't have the section
> for port 80:
> $SERVER["socket"] == ":80" {...}
> 
> I only have the 443 section:
> $SERVER["socket"] == "0.0.0.0:443" {...}
> 
> However it seems that port 80 works just fine. Is it by default?

Exactly. Port 80 is the default.

> > $SERVER["socket"] == ":80" {
> >   $HTTP["host"] =~ "example.org" {
> >     url.redirect = ( "^/(.*)" => "https://example.org/$1" )
> >     server.name                 = "example.org"
> >   }
> > }
> 
> > This will simplify the task 'redirect all non-ssl traffic to ssl'.
> 
> Is it possible to make the above section domain name independent?
> Meaning, to make it work for any domains as opposed of hard coding
> example.org?

$SERVER["socket"] == ":80" {
  $HTTP["host"] =~ "(.*)" {
    url.redirect = ( "^/(.*)" => "https://%1/$1" )
  }
}

> Thanks,
> Jack
> 
    Jan

-- 
Jan Kneschke                                     http://jan.kneschke.de/
Perhaps you want to say 'thank you, jan':    http://jk.123.org/wishlist/