Detailed process of using nginx to build a webdav file server in Ubuntu

Detailed process of using nginx to build a webdav file server in Ubuntu

Install nginx

Note that you must install nginx-full , the default nginx does not contain the webdav module

$ sudo apt install -y nginx-full

Create relevant folders

# The location used to save shared files$ sudo mkdir -p /home/dav
$ sudo chown -R www-data:www-data /home/dav

Configuration

$ sudo vim /etc/nginx/sites-enabled/webdav.conf

The content is as follows:

server {
    listen 80;

    server_name localhost;
	# Set to use utf-8 encoding to prevent Chinese file names from being garbled charset utf-8;

	# The default path for storing files is root /home/dav;

    auth_basic realm_name;
    # User password file storage location auth_basic_user_file /etc/nginx/.passwords.list;

    # dav allowed operations dav_methods PUT DELETE MKCOL COPY MOVE;
    dav_ext_methods PROPFIND OPTIONS;
    
    # Create the default permissions for files dav_access user:rw group:rw all:r;

    # Temporary file location client_body_temp_path /tmp;
    
    # Maximum upload file limit, 0 means unlimited client_max_body_size 0;
    
    # Enable automatic folder creation (if necessary)
    create_full_put_path on;
}

Generate Password

$ echo -n 'lpwm:' | sudo tee /etc/nginx/.passwords.list
$ openssl passwd -apr1 | sudo tee -a /etc/nginx/.passwords.list
# Restart nginx after confirming the password
$ sudo nginx -s reload

Windows Client

You can first use the browser to directly access the server IP to view

insert image description here

I tried to map the network drive directly in Windows File Explorer, but it didn't work! I used a third-party client: RaiDrive , which is quite conscientious. The standard version is free and supports up to 8 drives, which is obviously enough!

Download from official website: https://www.raidrive.com/download

After installation, you need to add server configuration:

insert image description here

Note that you can use the http protocol only if you uncheck Address , otherwise you can only use https by default

insert image description here

After adding, the mapped drive in the file explorer will be automatically opened

insert image description here

Nice!

insert image description here

The above is the details of using nginx to build a webdav file server in Ubuntu. For more information about using nginx to build a webdav file server, please pay attention to other related articles on 123WORDPRESS.COM!

You may also be interested in:
  • Methods and steps to build nginx file server based on docker
  • Graphic tutorial on configuring nginx file server in windows 10 system
  • Nginx learning static file server configuration method
  • Detailed explanation of nginx configuration static file server

<<:  Let’s talk in detail about how browsers view closures

>>:  Why should MySQL fields use NOT NULL?

Recommend

Tutorial on installing rabbitmq using yum on centos8

Enter the /etc/yum.repos.d/ folder Create rabbitm...

Five ways to achieve automatic page jump in HTML

In the previous article, we introduced three comm...

Summary of some reasons why crontab scheduled tasks are not executed

Preface I recently encountered some problems at w...

Detailed explanation of CSS image splicing technology (sprite image)

CSS image splicing technology 1. Image stitching ...

mysql-canal-rabbitmq installation and deployment super detailed tutorial

Table of contents 1.1. Enable MySQL binlog 1.2. C...

JavaScript ECharts Usage Explanation

I used ECharts when doing a project before. Today...

How to use jsonp in vue

Table of contents 1. Introduction 2. Installation...

JavaScript anti-shake and throttling explained

Table of contents Stabilization Throttling Summar...

Implementation of Grid common layout

No gaps on both sides, gaps between each column w...

Detailed introduction and usage examples of map tag parameters

Map tags must appear in pairs, i.e. <map> .....

CSS to achieve scrolling image bar example code

On some websites, you can often see some pictures...

Notes on using $refs in Vue instances

During the development process, we often use the ...

Detailed explanation of Vue options

Table of contents 1. What are options? 2. What at...

Ajax jquery realizes the refresh effect of a div on the page

The original code is this: <div class='con...