I have this line of code in my /etc/nginx/sites-available/default page:
rewrite ^/(.*)/(.*) /search.php?name=$1&last=$2
It accomplished what I wanted: cleaner urls for linking
example.com/john/smith is forwarded properly to the PHP GET.
But, it also destroyed all my styling and image links.
So I would like the rewrite to occur only if the first word is neither css nor image.
But I can only find if statements for GET arguments in the url not for directoies in the url like this:
if ($args ~* "/?param1=val1¶m2=val2&") {
rewrite ^ http://www.example.com/newparam/$arg_param1/$arg_param2? last;
}