December 21, 2016 05:19AM
Hi there,

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

https://sample.com/index.php?cl=accesstestprivate

should be access-able by IP address 192.168.1.1, 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 public.

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;
allow 192.168.1.1;
auth_basic $auth_type;
auth_basic_user_file conf/htpasswd;
proxy_pass http://devserver;
}
Any ideas?
Subject Author Posted

Nginx authentication based on parameterized url

tmuesele December 21, 2016 05:19AM

Re: Nginx authentication based on parameterized url

Francis Daly December 29, 2016 06:46AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 301
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