The Problem
Your comments say you're happy with your regular expressions and rewrite statements, and just need help with the parts around Nginx and location blocks.
A quick glance at them doesn't fill me with confidence that you have the rewrites correct. I would expect something more like this - note this will certainly be incorrect, is definitely not optimal, and may not even pass "nginx -t" checks.
rewrite ^/([0-9a-zA-Z_\-\s\+]+)?a=([0-9a-zA-Z_\-\s\+]+)&b=([0-9a-zA-Z_\-\s\+]+)*c=([0-9a-zA-Z_\-\s\+]+) /$2/$3/$4;
The general idea here is a capture group for each part of the URL you care about, plus one up front that's not used. That first one is just because I'm not great at regex and it's easier to copy and paste something from one of my own configurations that might work.
Nginx Locations and RegEx
Nginx rewrite can be in the server or location context, and work in the order in the configuration file. For you I'd probably put them near the top of the site config file, above the location blocks
server {
server_name example.com;
listen 80;
rewrite ^/?([^/]+)/([^/]+)/?$ /page-1.php?a=$1&b=$2 break;
rewrite ^/?([^/]+)/([^/]+)/([^/]+)/?$ /page-2.php?a=$1&b=$2&c=$3 break;
location / {
# Whatever you want in here to handle the rewritten or normally requested URLs
# root /var/www/html;
# proxy_pass 1.2.3.4;
}
location /a {
# If you want to handle specific URLs you can do it in another location block
}
}
Overall comment on your question is it's not very precise, and doesn't demonstrate that you've made any effort to solve the problem yourself.