Respond with a 404 when the file doesn't exist

Prior to this, I was seeing the successful HTTP status 200 when
requesting files that did not exist.

With this change, the server sends back Nginx's default 404 page instead
of the home page.
This commit is contained in:
Zach Ahn 2021-12-02 22:19:05 -05:00 committed by GitHub
parent 758bf7c39c
commit 6672b6257a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -23,7 +23,7 @@ http {
port_in_redirect off;
location / {
try_files $uri $uri/ /index.html;
try_files $uri $uri/ =404;
}
}
}