我继承了这台服务器,所以我对NGINX没有太多经验。但在我开始改变事情,把事情搞砸之前,我想看看是否能在这里找到一些帮助。
服务器显示主页,这些目录可以从那里访问。GET方法有效。web dav指令中没有设置POST,但尝试时得到403。我检查了access.log,看到的只是get查询。error.log显示以下内容。。。
2020/08/27 13:43:12[crit]31561#0:*1打开(("/usr/share/nginx/html/tmp/000000000001";失败(13:权限被拒绝(,客户端:myClient。CPE,服务器:服务器。CPE请求:";PUT/Tech_Support_Files/2020-08-27T13:43:10_2248066913312_TSI.tar.gz.aes HTTP/1.1";,主机:";服务器CPE";2020/08/27 13:44:12[crit]31561#0:*2打开(("/usr/share/nginx/html/tmp/000000000002";失败(13:权限被拒绝(,客户端:myClient。CPE,服务器:服务器。CPE请求:";PUT/Tech_Support_Files/2020-08-27T13:43:10_2248066913312_TSI.tar.gz.aes HTTP/1.1";,主机:";服务器CPE";2020/08/27 13:45:13[crit]31561#0:*3打开(("/usr/share/nginx/html/tmp/000000000003";失败(13:权限被拒绝(,客户端:myClient。CPE,服务器:服务器。CPE请求:";PUT/Tech_Support_Files/2020-08-27T13:43:10_2248066913312_TSI.tar.gz.aes HTTP/1.1";,主机:";服务器CPE";
所以这里似乎有权限问题,但我显然找不到它的来源。这是我的ls-l在它试图谈判的目录上,它看起来对我来说…
/usr/share/nginx/html
total 12
-rw-r--r--. 1 nginx nginx 3650 Oct 3 2019 404.html
-rw-r--r--. 1 nginx nginx 3693 Oct 3 2019 50x.html
lrwxrwxrwx. 1 nginx nginx 20 Apr 13 14:57 en-US -> ../../doc/HTML/en-US
drwxr-xr-x. 2 nginx nginx 27 Apr 13 14:57 icons
lrwxrwxrwx. 1 nginx nginx 18 Apr 13 14:57 img -> ../../doc/HTML/img
lrwxrwxrwx. 1 nginx nginx 25 Apr 13 14:57 index.html -> ../../doc/HTML/index.html
-rw-r--r--. 1 nginx nginx 368 Oct 3 2019 nginx-logo.png
lrwxrwxrwx. 1 nginx nginx 14 Apr 13 14:57 poweredby.png -> nginx-logo.png
drwxrwxr-x. 2 nginx nginx 22 Aug 21 16:59 Tech_Support_Files
drwxrwxr-x. 2 nginx nginx 6 Aug 25 18:48 tmp
任何对制作这部作品的见解都将不胜感激。这是当前的.conf文件。。。
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;
include /usr/share/nginx/modules/*.conf;
events {
worker_connections 1024;
}
http {
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 75;
types_hash_max_size 2048;
include /etc/nginx/mime.types;
default_type application/octet-stream;
include /etc/nginx/conf.d/*.conf;
server {
listen 443 ssl http2 default_server;
listen [::]:443 ssl http2 default_server;
server_name CPE_Uploads;
root /usr/share/nginx/html;
include /etc/nginx/self-signed.conf;
include /etc/nginx/default.d/*.conf;
add_header Strict-Transport-Security "max-age=7200";
add_header "allow: GET, PUT, HEAD, PURGE, DELETE, PATCH" always;
location / {
root /usr/share/nginx/html;
auth_basic "Restricted Site.";
auth_basic_user_file /etc/nginx/auth/Tech_Support_Files;
client_body_temp_path /usr/share/nginx/html/tmp/;
client_body_buffer_size 1M;
client_max_body_size 8M;
dav_methods PUT DELETE MKCOL COPY MOVE;
create_full_put_path on;
dav_access user:rw group:rw all:rw;
autoindex on;
}
error_page 404 /404.html;
location = /40x.html {
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
}
}
这是通过移动nginx用户主目录中的所有内容来解决的。