Welcome! Log In Create A New Profile

Advanced

PUT & access_by_lua_file

April 16, 2015 04:27AM
Здравствуйте уважаемые!
Наблюдаю странное поведение nginx.
В тестовом авторизационном файле луа сказано, что метод PUT запрещён (см листинг ниже).
И при этом когда захожу вижу, что сначало nginx разрешает PUT и идет передача файла на WEBDAV и только после завершения передачи файла nginx стартует access_by_lua_file /etc/nginx/lua/auth-dav1.lua и возвращает запрет PUT(передачи файла)... см лог ниже.
По факту получается, что я не могу запретить из луа-авторизатора передачу файла? конечно его размещение запрещается... но при этом он качается на сервер и излишне грузит nginx и канал!!!
Почему так? Это баг, фича, я глючу или ещё чвото?

------------------------
лог файл BitKinex (кстати FAR-NetDrive ведёт себя анналогично)
Resolving host name "dav.example.com" ...
Connecting ( dav.example.com => ip: 10.0.0.1, port: 80 )
Connected (10.0.0.1:80)
<<< PUT /IMG_20150414_184225.jpg HTTP/1.1
<<< Host: dav.example.com
<<< User-Agent: BitKinex/3.2.3
<<< Accept: */*
<<< Pragma: no-cache
<<< Cache-Control: no-cache
<<< Content-Length: 696983
<<< Content-Type: application/octet-stream
<<< Translate: f
>>> HTTP/1.1 405 Not Allowed
>>> Server: nginx/0.8.54
>>> Date: Thu, 16 Apr 2015 08:08:52 GMT
>>> Content-Type: text/html
>>> Connection: keep-alive
>>> Content-Length: 173
Connection closed

-----------------------------
Конфиг virt

dav.conf
server {
listen 80;
server_name dav.example.com;
server_name_in_redirect off;
access_log /var/log/nginx/dav-access.log main;
resolver 10.255.255.1 [::1]:5353;
set $dir /opt/home;
set $dir_path $dir;
if ($uri ~* ^(.*)([$/].*)$) {
set $dir_path $dir$1;
}
set $home $dir_path;
set $sadm_passwd .htpsw;
set $user_passwd .uhtpasswd;
location / {
access_by_lua_file /etc/nginx/lua/auth-dav1.lua;
dav_methods PUT DELETE MKCOL COPY MOVE;
dav_ext_methods PROPFIND OPTIONS;
create_full_put_path on;
dav_access user:rw group:rw;
client_body_temp_path /opt/itcod-dav.tmp/;
client_max_body_size 0;
autoindex on;
root /opt/home/;
}
location ~/\.ht {
deny all;
}
}
---------------------------------------------------
тестовый листинг луа
auth-dav1.lua

if ngx.var.request_method == 'PUT' then
ngx.exit(405)
end

PS: так же пробовал ngx.exit(403) ngx.exit(423) - результат не меняется. сначало грузит потом запрещает.
Subject Author Posted

PUT & access_by_lua_file

itcod April 16, 2015 04:27AM

Re: PUT & access_by_lua_file

itcod April 16, 2015 04:51AM

Re: PUT & access_by_lua_file

Илья Шипицин April 16, 2015 06:34AM

Re: PUT & access_by_lua_file

itcod April 16, 2015 02:56PM

Re: PUT & access_by_lua_file

Илья Шипицин April 16, 2015 06:36AM

Re: PUT & access_by_lua_file

itcod April 16, 2015 02:47PM

Re: PUT & access_by_lua_file

Илья Шипицин April 16, 2015 11:26PM

Re: PUT & access_by_lua_file

itcod April 17, 2015 02:07AM

Re: PUT & access_by_lua_file

mva April 17, 2015 02:16AM

Re: PUT & access_by_lua_file

itcod April 17, 2015 02:50AM

Re: PUT & access_by_lua_file

mva April 17, 2015 06:32AM

Re: PUT & access_by_lua_file

itcod April 17, 2015 08:30AM

Re: PUT & access_by_lua_file

Илья Шипицин April 17, 2015 07:12AM

Re: PUT & access_by_lua_file

itcod April 17, 2015 08:36AM

Re: PUT & access_by_lua_file

mva April 17, 2015 08:46AM

Re: PUT & access_by_lua_file

itcod April 17, 2015 09:01AM

Re: PUT & access_by_lua_file

itcod April 17, 2015 09:05AM

Re: PUT & access_by_lua_file

itcod April 17, 2015 11:12AM

Re: PUT & access_by_lua_file

Oleksandr V. Typlyns'kyi April 17, 2015 06:02PM

Re: PUT & access_by_lua_file

itcod April 18, 2015 01:34AM

Re: PUT & access_by_lua_file

Илья Шипицин April 17, 2015 02:52PM

Re: PUT & access_by_lua_file

itcod April 18, 2015 01:56AM

Re: PUT & access_by_lua_file

itcod April 17, 2015 03:03AM

Re: PUT & access_by_lua_file

itcod April 17, 2015 01:58PM

Re: PUT & access_by_lua_file

itcod April 17, 2015 02:41PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 173
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready