How to set up a specified route for nginx to access and directly jump to 404 status codes

for example: my domain name is www.abc.com
I want to specify that when a user accesses www.abc.com/xx/, he / she will directly report the 404 status code so that it cannot open
but can access other routing www.abc.com/yy/ to access

normally.

add: the domain name www.abc.com and m.abc.com domain name access the same set of source codes.
to implement www.abc.com/xx/ report 404, while m.abc.com/xx/ can access it normally

Mar.05,2021

xx refers specifically, right?

location / xx {

return 404; 

}


location /xx/ {
        return 404;
}

location / xx/ {

    return 404;

}
xx is another directory under the root directory


just be a location

Menu