Works for me (so far):
map $query_string $bad_query {
"~[^&;]+([&;][^&;]*){1,}" 1; # deny two or more
parameters
"~emailaddress=[^@]+%40[^@]+" 0; # allow Thunderbird autoconf
"~.+=.+"1; # deny any other
query
defau
Also, It might be better to check the $arg_*argument *variable instead and
also set a check for $is_args. NGINX will process them in order within the
configuration.
map $is_args $redirect {
"?" "1";
default "";
}
map $arg_emailaddress $redirect {
~.+%40[a-z
Hi,
You would be better to accomplish this with map. Would this work?
map $args $redirect {
~emailaddress=.+%40[a-zA-Z0-9\.\-] '';
default "1";
}
server {
...
location / {
...
}
location /foo {
if ($redirect)
Hello,
Our local policy demands the rejection of any query; we do this as follows:
if ($is_args) { return 301 /; }
The introduction of Thunderbird autoconfiguration demands an exception to
the above policy, because of
"GET
/.well-known/autoconfig/mail/config-v1.1.xml?emailaddre=uname%40example.