我有一个问题, satisfy any server或location块导致所有客户端被允许访问,这不是预期的行为。
server { listen 80; server_name raar.my.domain; satisfy any; allow 192.168.1.0/24; deny all; auth_basic "Private"; auth_basic_user_file /etc/nginx/conf.d/avs.creds; location / { proxy_pass http://192.168.1.13:8085; } }
在这种状态下,我可以从外部主机发出请求,并将请求传递给代理。 如果我改变any ,那么它实际上开始调用访问机制。
这是因为在/etc/nginx其他任何地方都不会出现allow和deny关键字,所以我不知道其他访问处理程序甚至可以存在以satisfy any 。
debugging日志什么都没显示
-V:
nginx -V nginx version: nginx/1.2.7 TLS SNI support enabled configure arguments: --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=nginx --group=nginx --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_stub_status_module --with-mail --with-mail_ssl_module --with-file-aio --with-ipv6 --add-module=/tmp/pubcookie_src/src/nginx
呃,事实certificate,这是公用事业单位行为不端。
当正确的答案是NGX_DECLINED(以及将其作为int而不是ngx_int_t返回)时,它在返回NGX_OK的时候返回了它不负责的站点。
出于这个原因satisfy any被满足。