My script made in cgi-bin is using html input form to login. After submitting the form, password is visible in URL. I would like to rewrite this URL so the password is not visible in the address bar.
I would like to change this /cgi-bin/script.sh?host=somehost&user=user&pass=password
to /cgi-bin/script.sh So basically match all behind script.sh and remove it. This ^script.sh(.*) would match my use case but it's not working.
This is my simple Nginx config:
server {
listen 80;
server_name x.x.x.x;
location /cgi-bin/ {
gzip off;
root /var/www;
fastcgi_pass unix:/var/run/fcgiwrap.socket;
include /etc/nginx/fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}
Any tips appreciated.