我实在太难了,我找不到配置文件第一行哪里出错了 [email protected]:~# nginx -t nginx: [emerg] "server" directive is not allowed here in /etc/nginx/nginx.conf:1 nginx: configuration file /etc/nginx/nginx.conf test failed 原帖 https://blog.csdn.net/lpwmm/article/details/116943643
- server {
- listen 80;
-
- server_name localhost;
- # 设置使用utf-8编码,防止中文文件名乱码
- charset utf-8;
-
- # 默认存放文件的路径
- root /home/dav;
-
- auth_basic realm_name;
- # 用户密码文件存放位置
- auth_basic_user_file /etc/nginx/.passwords.list;
-
- # dav 允许的操作
- dav_methods PUT DELETE MKCOL COPY MOVE;
- dav_ext_methods PROPFIND OPTIONS;
-
- # 创建文件的默认权限
- dav_access user:rw group:rw all:r;
-
- # 临时文件位置
- client_body_temp_path /tmp;
-
- # 最大上传文件限制, 0表示无限制
- client_max_body_size 0;
-
- # 允许自动创建文件夹(如果有需要的话)
- create_full_put_path on;
- }
复制代码
|