Subversion Repositories ALCASAR

Rev

Rev 3110 | Details | Compare with Previous | Last modification | View Log

Rev Author Line No. Line
2592 rexy 1
$HTTP["url"] =~ ".*" {
2
    # Disabling directory listing as default setting
3
    dir-listing.activate = "disable"
4
}
5
 
6
# If a wrong url is used, displaying homepage for unprivileged users
7
$HTTP["url"] !~ "^/(acc|save)/" {
8
    server.error-handler-404 = "/"
9
}
10
 
11
# Error pages
12
server.errorfile-prefix = "/var/www/html/errors/error-" 
13
 
14
$SERVER["socket"] == "alcasar.localdomain:443" {
15
    ssl.engine = "enable"
16
    ssl.pemfile = "/etc/pki/tls/private/alcasar.pem"
3191 rexy 17
    ssl.verifyclient.ca-file = "/etc/pki/tls/certs/server-chain.pem"
2592 rexy 18
    var.server_name = "alcasar.localdomain"
19
    server.name = server_name
20
    server.document-root = "/var/www/html"
21
}
22
 
23
$HTTP["scheme"] == "https" {
24
    alias.url = (
25
        "/save" => "/var/Save"
26
    )
27
    # Digest authentication configuration
28
    auth.backend = "htdigest"
29
    auth.require = (
30
        "/acc/" => 
31
        (
32
            "method"  => "digest",
33
            "realm"   => "ALCASAR Control Center (ACC)",
34
            "require" => "valid-user"
35
        ),
36
        "/save/" => 
37
        (
38
            "method"  => "digest",
39
            "realm"   => "ALCASAR Control Center (ACC)",
40
            "require" => "valid-user"
41
        )
42
    )
43
    $HTTP["url"] =~ "^/(acc|save)/" {
44
        # Setting digest files according access permissions
45
        $HTTP["url"] =~ "^/acc/" {
46
            auth.backend.htdigest.userfile = "/usr/local/etc/digest/key_all"
47
 
48
            $HTTP["url"] =~ "^/acc/admin" {
49
                auth.backend.htdigest.userfile = "/usr/local/etc/digest/key_admin"
50
            }
51
 
52
            $HTTP["url"] =~ "^/acc/manager/" {
53
                auth.backend.htdigest.userfile = "/usr/local/etc/digest/key_manager"
54
            }
55
 
56
            $HTTP["url"] =~ "^/acc/backup/" {
57
                auth.backend.htdigest.userfile = "/usr/local/etc/digest/key_backup"
58
            }
59
        }
60
        $HTTP["url"] =~ "^/save" {
61
            auth.backend.htdigest.userfile = "/usr/local/etc/digest/key_backup"
62
            # Enabling directory listing
63
            dir-listing.activate = "enable"
64
        }
65
    }
66
}
67
 
68
$HTTP["scheme"] == "http" {
69
	# Force HTTPS for specific pages
70
	$HTTP["url"] =~ "^/(acc|save)" {
71
		$HTTP["host"] =~ ".*" {
72
			url.redirect = (".*" => "https://%0$0")
73
		}
74
	}
75
}