I want to discard all the query parameters and add a new one (for instance DN=$ssl_client_s_dn). The reason is to prevent the client from sending this query parameter.
Replacing the value of the query parameter "DN", is also a valid solution for me.
My configuration file is
server {
listen 9999 ssl default_server;
listen [::]:9999 ssl default_server;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_certificate /keystores/mycert.crt.pem; ##
ssl_certificate_key /keystores/mycert.key.pem; ##
ssl_client_certificate /keystores/.npm.certs.pem; ## CA Bundle
ssl_verify_client on;
root /home/edu/my-react-app;
index index.html;
server_name _;
location / {
try_files $uri $uri/ /index.html =404;
}
location = /login {
if ($arg_DN = "") {
rewrite ^ /login?DN=$ssl_client_s_dn redirect;
}
try_files /index.html =404;
}
}
I want to use the "DN" query parameter as a login system. But the client can fool me by sending a false DN belonging to a user with higher privileges!
Any idea?