Nginx auth_request モジュールで IP アドレスが認証をバイパスできるようにする

Nginx auth_request モジュールで IP アドレスが認証をバイパスできるようにする

以下のような設定があります。IP のリストが認証をバイパスできるようにしたいと思います。

server {
 listen 80;

 server_name test2.example.com;
 add_header Strict-Transport-Security max-age=2592000;

  location = /oauth2/auth {
      internal;
      proxy_pass http://oauth.example.com:4180;
  }

  location /oauth2/ {
      proxy_pass http://oauth.example.com:4180;
      proxy_set_header Host $host;
      proxy_set_header X-Real-IP $remote_addr;
      proxy_set_header X-Scheme $scheme;
  }

  location / {
    auth_request /oauth2/auth;
    error_page 401 = /oauth2/start?rd=$request_uri;
    proxy_pass https://test.example.com;
  }
}

上記を追加してみましたauth_requestが、効果がないようです。ログを見ると、リクエストがホワイトリストに登録された IP から来ていることがわかります。

satisfy all;
allow 10.0.0.0/16;
allow 56.56.56.56/28;
deny all;

更新: IP アドレスのバイパスsatisfy allを修正しました。satisfy any

関連情報