Alex Rivera | Logout

Configuring nginx to return a 404 when a URL matches a pattern

Asked 2011-01-12T02:39:37.157
87

I want nginx to return a 404 code when it receives a request which matches a pattern, e.g., /test/*. How can I configure nginx to do that?

Edit
Report

1 Answer

10
location ^~ /test/ {
    internal;
}
answered 2011-01-12T02:58:52.177

Your Answer