Introduction
- Configure a WebDAV Server with NGINX
- User cloud access specified folder after login
Environment
GCP Instance
Ubuntu 18.04
NGINX
Root
Install
apt-get install nginx-full |
Turn on gzip
Bandwidth is limited, and the performance of machines is always faster, so we compress data with gzip before sending them to customer to decrease the amount of traffic
sed -i '/gzip_/ s/#\ //g' /etc/nginx/nginx.conf |
/gzip_/: Look for lines containing gzip_
s/#\ //g: Replace #
with
It means that we uncomment the gzip
Configure WebDAV Server
Create config file
vim /etc/nginx/conf.d/webdav.conf |
Config
server { |
Create users
- 輸入 userPrint out the user name,
echo -n 'userName:' | sudo tee -a /etc/nginx/.credentials.list;
tee
will print the user and direct it into /etc/nginx/.credential.list file
- Enter passwordTurn password to encrypted characters with
openssl passwd -apr1 | sudo tee -a /etc/nginx/.credentials.list;
openssl passwd -apr1
rule, print and direct into /etc/nginx/.credentials.list file.-a
= append
Comments