K
K
Kamo Petrosyan2016-11-18 10:12:02
Nginx
Kamo Petrosyan, 2016-11-18 10:12:02

How to configure nginx to return 404 when request without extension?

The crux of the issue I think is clear. If the uri does not contain an extension (any)? you need to give a 404 response.
Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Peter, 2016-11-18
@petermzg

so for location regex
you set something like:

location ~* \.(gif|jpg|jpeg)$ {
    [ configuration E ]
}

And of course stackoverflow.com/questions/12948023/how-to-match-...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question