dav_access

The `dav_access` directive controls access permissions for WebDAV resources in NGINX.

Syntaxdav_access allow|deny ip_address;
Defaultnone
Contexthttp, server, location
Arguments1-3

Description

The dav_access directive is used within the NGINX HTTP module to specify rules that control access to WebDAV resources based on client IP address. By allowing or denying specific IP addresses or address ranges, site administrators can manage who can interact with the resources made available through WebDAV. This directive can include between one and three arguments depending on the desired operations, which typically involve specifying 'allow' for granting access or 'deny' to restrict access. It operates by checking the incoming request's IP address against the provided rules, permitting or blocking the request accordingly.

When configuring dav_access, administrators can define multiple rules, which can either be inclusive (allow) or exclusive (deny). The rules can be structured hierarchically, meaning that a deny rule can override an allow rule if they conflict. Appropriate attention must be given to the order of the rules, as NGINX processes them in sequence and will apply the action that corresponds to the first matching rule. Users may also combine IPv4 and IPv6 rules, which are handled separately in the configuration.

Config Example

location /webdav {
    dav_methods PUT DELETE MKCOL COPY MOVE;
    dav_access allow 192.168.1.0/24;
    dav_access deny all;
}

Ensure IP addresses are correctly formatted to avoid accidental lockouts.

Ordering of allow and deny rules can cause unexpected access; check the sequence of directives.

Be cautious with 'deny all' as it might block all access if misconfigured.

← Back to all directives