nginx: matching exact returns 404

0

I'm having a silly difficulty, I guess, with nginx . The situation is simple.

A small site with a very small number of pages ( html files). Because the site is small, I'd like to use exact matchings in the locations . The server block in my configuration file is as follows:

server {
    listen 80;

    server_name localhost;

    location / {
        root   /usr/share/nginx/html/;

        location =/ {
            index index.html;

        }

        location =/blog {
            index blog.html;

        }

        location =/contact {
            index contact.html;

        }

        location =/about {  
            index about.html;

        }

    }

}

The idea is for pages to be accessed with .html requests, returning error 404 when using .html and that responses be quick.

But the way it's set up, I've been getting error 404 when the request is .html , however the pages have been returned when appending the < in> .html

Could anyone explain this to me?

    
asked by anonymous 23.06.2018 / 17:40

0 answers