limit except и dav

ivanko nginx-forum at nginx.us
Sun Aug 25 01:31:39 UTC 2013


Друзья! прошу помочь с RTFM на тему совмещения dav и limit_except - не
выходит ограничить доступ (((
Хочется закрыть доступ с любыми методами от одного ip, а все остальные могут
путать и постить. 

nginx]$ date; ./sbin/nginx -V; sed -n "/#start/,/#end/ p" conf/nginx.conf;
./sbin/nginx -p $PWD -s reload; tail logs/error.log -n 1;/sbin/ifconfig
|grep 172.16.4.39; ls -l var/www/cert.crl ;curl -T ../cert.crl
http://172.16.4.39:8080/ -D -; curl -D - -o /dev/null
http://172.16.4.39:8080/cert.crl -s; grep -h 172.16.4.39
logs/*access.log|tail -2; ls -l var/www/cert.crl
Sun Aug 25 05:28:00 MSK 2013
nginx version: nginx/1.4.2
built by gcc 4.1.2 20080704 (Red Hat 4.1.2-50)
configure arguments: --with-http_dav_module
        #start
server {
        listen 8080;
        server_name localhost
        client_body_temp_path client_body_temp;
        client_max_body_size 0;
        location / {
                limit_except GET {
                        deny 172.16.4.39;
                        allow all;
                }
                location ~* \.crl {
                        types {
                                application/x-pkcs7-crl crl;
                        }
                }
                root var/www/;
                dav_methods PUT;
                create_full_put_path on;
                dav_access group:r all:r;
        }
    }
        #end
2013/08/25 05:28:00 [notice] 7367#0: signal process started
          inet addr:172.16.4.39  Bcast:172.16.4.255  Mask:255.255.255.0
ls: var/www/cert.crl: No such file or directory
HTTP/1.1 100 Continue

HTTP/1.1 201 Created
Server: nginx/1.4.2
Date: Sun, 25 Aug 2013 01:28:00 GMT
Content-Length: 0
Location: http://172.16.4.39:8080/cert.crl
Connection: keep-alive

HTTP/1.1 200 OK
Server: nginx/1.4.2
Date: Sun, 25 Aug 2013 01:28:00 GMT
Content-Type: application/x-pkcs7-crl
Content-Length: 145188
Last-Modified: Sun, 25 Aug 2013 01:28:00 GMT
Connection: keep-alive
ETag: "52195da0-23724"
Accept-Ranges: bytes

172.16.4.39 - - [25/Aug/2013:05:26:49 +0400] "PUT /cert%2Ecrl HTTP/1.1" 201
25 "-" "curl/7.15.5 (i386-redhat-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8b
zlib/1.2.3 libidn/0.6.5"
172.16.4.39 - - [25/Aug/2013:05:26:49 +0400] "GET /cert.crl HTTP/1.1" 200
145188 "-" "curl/7.15.5 (i386-redhat-linux-gnu) libcurl/7.15.5
OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5"
-rw-r--r-- 1 ivanko users 145188 Aug 25 05:28 var/www/cert.crl
nginx]$

Posted at Nginx Forum: http://forum.nginx.org/read.php?21,242191,242191#msg-242191



Подробная информация о списке рассылки nginx-ru