В результате решил проблему так: location ~* /admin { auth_basic "admin location"; auth_basic_user_file conf.d/htpasswd; root /path/to/nowhere; error_page 404 = @redirect; } location @redirect { rewrite ^/([^\/]+)$ /index.phpby aquarius - Nginx Mailing List - Russian
Andrey Kopeyko Wrote: ------------------------------------------------------- > 11.10.2012 11:02, aquarius пишет: > > > ... > > если rewrite исключить из локейшена admin, то пароль просит, но > ведет не > > туда куда надо. Как я понимаю, rewrite отрабатывает раньше auth,by aquarius - Nginx Mailing List - Russian
location /admin { auth_basic "admin location"; auth_basic_user_file conf.d/htpasswd; rewrite ^/([^\/]+)$ /index.php?api=$1; index index.php; } location ~ \.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_parby aquarius - Nginx Mailing List - Russian