Welcome! Log In Create A New Profile

Advanced

return 301 не обрабатывается в location allow IP+deny all

February 11, 2015 01:02AM
Доброго дня.
Имеется задание для одного location разрешить редирект для white list и запретить доступ всем остальным.
Реализовано это так:
location / {
proxy_pass http://web_upstream;
return 301 https://example.com;
allow 1.1.1.1;
allow 2.2.2.2
deny all;
}

Работает это так, что с любого IP идёт редирект на https://example.com

Что сделано не так?
Буду признателен за любую помощь.
Спасибо за внимание.

PS
FreeBSD 9.1-RELEASE-p4
nginx -V
nginx version: nginx/1.4.6
TLS SNI support enabled
configure arguments: --prefix=/usr/local/etc/nginx --with-cc-opt='-I /usr/local/include' --with-ld-opt='-L /usr/local/lib' --conf-path=/usr/local/etc/nginx/nginx.conf --sbin-path=/usr/local/sbin/nginx --pid-path=/var/run/nginx.pid --error-log-path=/var/log/nginx-error.log --user=www --group=www --with-debug --with-ipv6 --http-client-body-temp-path=/var/tmp/nginx/client_body_temp --http-fastcgi-temp-path=/var/tmp/nginx/fastcgi_temp --http-proxy-temp-path=/var/tmp/nginx/proxy_temp --http-scgi-temp-path=/var/tmp/nginx/scgi_temp --http-uwsgi-temp-path=/var/tmp/nginx/uwsgi_temp --http-log-path=/var/log/nginx-access.log --with-http_addition_module --without-http-cache --with-http_geoip_module --with-http_realip_module --with-http_stub_status_module --with-http_sub_module --with-pcre --add-module=/usr/ports/www/nginx/work/gabor-nginx-x-rid-header-0daa3cc --with-http_ssl_module
Subject Author Posted

return 301 не обрабатывается в location allow IP+deny all

smartlight February 11, 2015 01:02AM

Re: return 301 не обрабатывается в location allow IP+deny all

igor.goncharenko February 11, 2015 02:11AM

Re: return 301 не обрабатывается в location allow IP+deny all

smartlight February 11, 2015 03:13AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 162
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready