1

I am running lighttpd 1.4.19. I have mod_auth enabled. If I do something like:

auth.require = ( "/" => (
            "method" => "digest",
            "realm" => "Authorized users only",
            "require" => "user=someuser"
            )
        )

my main website on port 80 gets auth. However, I would like to enable auth for a website running on a custom port (say 8080). I handle my custom port website with the following config:

$SERVER["socket"] == ":8080" {
        $HTTP["host"] =~ "^www.mysite.com" { 
                include "my8080site.conf"
        }
}

Can anyone help out? The auth only works for the site running on port 80.

1 Answer 1

1

Try putting the auth.require bit inside of your server definition:

$SERVER["socket"] == ":8080" {
    auth.require = ( "/" => (
        "method" => "digest",
        "realm" => "Authorized users only",
        "require" => "user=someuser"
        )
    )
    $HTTP["host"] =~ "^www.mysite.com" { 
            include "my8080site.conf"
    }
}

This seems to work in my test setup (although I don't know if it's a fully valid test, since I don't see your entire configuration).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .