Nginx authentication based on parameterized url

tmuesele nginx-forum at
Wed Dec 21 10:19:55 UTC 2016

Hi there,

I need an authentication based on a parameterized class call in a url. For
example the url:

should be access-able by IP address, if the request doesnt come
from this IP, a basic auth should be invoked.

All other / pages e.g. index.php, index.php?start=1 should be access-able by

I was trying to use the map function. But in this case, the site is not
available from public.

map $arg_cl $auth_type {
 default       „off";
 "accesstestprivate“ "closed";

location / {
  satisfy any;
  auth_basic $auth_type;
  auth_basic_user_file conf/htpasswd;
  proxy_pass http://devserver;
Any ideas?

Posted at Nginx Forum:,271665,271665#msg-271665

More information about the nginx mailing list