Lighttpd Redirect to SSL results in 301 redirect loop

view full story

http://serverfault.com – I am running lighttpd 1.4.31 with ssl support and am having an issue with forcing https on a specific virtualhost. If I disable the redirect line from the following config, it works as expect (http and https both working, but no redirection), but when I enable it, I find the browser gets cause in a loop of 301s. I don't understand why this is happening as to me the redirect should only apply under http. I have mod_redirect loaded in at the top of the config, and one other virtualhost with ssl forced on for some domain...I don't believe that should have any impact. What am I doing wrong in (HowTos)