logdir = $logdir$

ebin_dir = $data_builddir$

trace                          = false
copy_error_log                 = true
log_wrap_size                  = 1000000
log_resolve_hostname           = false
fail_on_bind_err               = true
pick_first_virthost_on_nomatch = true
keepalive_timeout              = 10000

<server localhost>
        port = $yaws_port1$
        listen = 127.0.0.1
        deflate = true
        docroot = $data_srcdir$/www1 $data_srcdir$/www2
        arg_rewrite_mod = rewritetest

        <auth>
           # Auth needed to access to test1 in www2,
           realm = test1
           dir = /test1
           user = foo:bar
           user = "foo:{sha256}szTXjROUAlPTDWcL0pxczKpZCGFPK0W5qa0EAkp8l5Q=" #sha256baz
           user = "foo:{md5}C5GxiXRrcq9Eih5W1CqNaA==" #md5baz
           user = "foo:{sha256}$WaKEFH0eG+l60yB2VpaIp+27flw6Hhm2NLrnV/mZopA=$x0RbTgVEu0QiL/DRvtoXRYcU6hfX/Ir3LPkwVJLjwBw=" #sha256baz_with_salt
        </auth>

        <auth>
           # Auth needed to access to test2/a.txt in www1,
           # but not for test2/b.txt in www2,
           docroot = $data_srcdir$/www1
           realm = test2
           dir = /test2
           user = foo:bar
        </auth>

        <auth>
           # Auth needed to access to test3 in www1,
           # and all subdirs
           realm = test3
           dir = /test3
           user = foo:bar
        </auth>

        <auth>
           # Use authmod to authenticate users
           realm = test4
           dir = /test4
           authmod = authmodtest
        </auth>

        <auth>
           # Use authmod to authenticate users,
           # it will set the outmod to handle 401 output
           realm = test5
           dir = /test5
           authmod = outmodtest
        </auth>

        <auth>
          # because of order value, 127.0.0.1 is authorized
          realm = test6
          dir = /test6
          deny = all
          allow = 127.0.0.1
          order = deny,allow
        </auth>

        <auth>
          # because of order value, 127.0.0.1 is denied
          realm = test7_1
          dir = /test7
          deny = all
          allow = 127.0.0.1
          order = allow,deny
        </auth>

        <auth>
          # Override previous test to authorized 127.0.0.1
          # (deny target was removed)
          realm = test7_2
          dir = /test7/b.txt
          allow = 127.0.0.1
          order = allow,deny
        </auth>

        <auth>
          # because of order value, all ips are denied
          # (no allow or deny target)
          realm = test8_1
          dir = /test8/a.txt
          order = allow,deny
        </auth>

        <auth>
          # because of order value, all ips are authorized
          # (no allow or deny target)
          realm = test8_2
          dir = /test8/b.txt
          order = deny,allow
        </auth>

        <auth>
          # Use many auth method: authmod + basic auth + acls
          # authorized is Ip=127.0.0.1 and user:pass == foo:baz
          realm = test9
          dir = /test9
          authmod = authmodtest # return false is user:pass != foo:bar
          user = foo:baz
          deny = all
          allow = 127.0.0.1
          order = deny,allow
        </auth>

        # /test11_1 is redirected to /test1. There is no check for /test11_1, so
        # only those on /test1 are applied.

        <auth>
           # /test11_2 is redirected to /test1. So check /test11_2 and /test1:
           #  - Only user foo:bar can access to /test11_2
           #  - Only user foo:bar can access to /test1
           #
           # => Requests to /test11_2 are always accepted for user foo:bar and
           #    denied for everybody else.
           realm = test11_2
           dir = /test11_2
           user = foo:bar
        </auth>

        <auth>
           # /test11_3 is redirected to /test1. So check /test11_3 and /test1:
           #  - Only user foo:baz can access to /test11_3
           #  - Only user foo:bar can access to /test1
           #
           # => Requests to /test11_3 are always rejected
           #   (same user, different password)
           realm = test11_3
           dir = /test11_3
           user = foo:baz
        </auth>

        <auth>
           # /test11_4 is redirected to /test7. So check /test11_4 and /test7:
           #  - Only user foo:bar can access to /test11_4
           #  - /test7/a.txt is forbidden  for 127.0.0.1
           #  - /test7/b.txt is authorized for 127.0.0.1
           #
           # => Requests to /test11_4/a.txt coming from 127.0.0.1 are rejected
           # => Requests to /test11_4/b.txt coming from 127.0.0.1 are accepted
           #    for user foo:bar only
           realm = test11_4
           dir = /test11_4
           user = foo:bar
        </auth>
</server>
