{% for share in nas_shares %} {% if share.protocols.http.enabled %} Alias /{{ share.name }} {{ share.path | default(nas_root_dir + '/data/' + share.name) }} RewriteEngine On {% if share.protocols.http.force_ssl %} RewriteCond %{HTTPS} =off RewriteRule ^/{{ share.name }}(/.*|$) https://%{HTTP_HOST}/{{ share.name }}$1 {% endif %} Options None Options +FollowSymlinks {% if share.protocols.http.force_ssl %} SSLRequireSSL On {% endif %} {% if share.protocols.http.indexes %} Options +Indexes {% endif %} {% if share.protocols.http.webdav %} Dav On {% endif %} {% if not share.protocols.http.public %} AuthType Basic AuthName "Authenicated zone" AuthBasicProvider external AuthExternal pwauth # Read only access {% for user in share.acl.read_users %} Require user {{ user }} {% endfor %} {% for group in share.acl.read_groups %} Require unix-group {{ group }} {% endfor %} # Write access through webdav always requires authentication {% for user in share.acl.write_users %} Require user {{ user }} {% endfor %} {% for group in share.acl.write_groups %} Require unix-group {{ group }} {% endfor %} {% endif %} {% endif %} {% endfor %}