I build my webdav server this way:
apt-get install nginx-full
vim /etc/nginx/conf.d/webdav.conf
server {
listen 80;
listen [::]:80;
server_name vps_ip;
auth_basic realm_name;
auth_basic_user_file /etc/nginx/.credentials.list;
dav_methods PUT DELETE MKCOL COPY MOVE;
dav_ext_methods PROPFIND OPTIONS;
dav_access user:rw group:rw all:r;
client_max_body_size 0;
create_full_put_path on;
}
#add username and password
echo -n 'userName:' | sudo tee -a /etc/nginx/.credentials.list;
openssl passwd -apr1 | sudo tee -a /etc/nginx/.credentials.list;
#restart my nginx
systemlctl restart nginx
Type my vps ip in browser and input username and password, it will pop up the window over and over
How to fix it then?
1.account and password
I have set account and password as sammy
,sammy
.
cat /etc/nginx/.credentials.list
$apr1$8n9ND3iO$5.vkNPeJZ5h3jJ/d.onJ81
2.log
cat /var/log/nginx/access.log
xxxx - - [26/Jul/2021:00:26:12 +0000] "GET /.env HTTP/1.1" 401 597 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.129 Safari/537.36"
xxxx - - [26/Jul/2021:00:26:13 +0000] "POST / HTTP/1.1" 401 597 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.129 Safari/537.36"
xxxx - - [26/Jul/2021:00:27:54 +0000] "GET / HTTP/1.1" 400 173 "-" "-"
xxxx - - [26/Jul/2021:00:39:28 +0000] "GET / HTTP/1.1" 401 195 "-" "Mozilla/5.0 (compatible; CensysInspect/1.1; +https://about.censys.io/)"
cat /var/log/nginx/error.log
#Nothing in /var/log/nginx