Skip to content

Commit

Permalink
Improve404 (#147)
Browse files Browse the repository at this point in the history
* improve handling of error pages

the current version can handle files missing, but it can not handle
directories missing.

https://docs.stakater.com/mto/main/reference-guides/admin-clusterrole.html
Fails to show a nice looking 404.

https://docs.stakater.com/mto/main/obviously_missing_file
succeeds.

With this change, both should work.

Not sure what internal does or if is needed, have tested on a local
nginx only.

* needed for 403

I realized try_files failed to handle 403, so this repairs that part

* remove duplicate field
  • Loading branch information
Andtalath authored Aug 1, 2024
1 parent de1f61a commit 1c2f0f2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ server {
listen 8080;
root /usr/share/nginx/html/;
index index.html;
error_page 403 /404.html;
location = /404.html {
internal;
}
location / {
try_files $uri $uri/ /404.html;
}
Expand Down

0 comments on commit 1c2f0f2

Please sign in to comment.