You are not logged in.

#1 2012-09-04 20:29:07

firecat53
Member
From: Lake Stevens, WA, USA
Registered: 2007-05-14
Posts: 1,542
Website

Lighttpd https redirect for only certain directories

This works great for redirecting all traffic to https on my home server:

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

However, I'm trying to exclude one directory from this (other people using it, self-signed ssl messages...you get the idea smile ) and I can't quite wrap my brain around it. Server Fault and Stackoverflow had some examples that were close, but I couldn't manipulate them into doing what I wanted. A gentle shove in the right direction would be much appreciated.

Very simple layout: /srv/http/<dir1> /srv/http/<dir2> /srv/http<dir3> etc. Call it 'foo-dir' that I want to exclude. The server sits behind a consumer router with all port 80 and 443 traffic directed to the server's static IP.  External IP via dyndns.

Thanks!
Scott

Offline

Board footer

Powered by FluxBB