1
0
mirror of https://github.com/dokku/buildpack-nginx.git synced 2025-06-26 02:20:47 +00:00

feat: allow overriding default 404 response with custom file

This allows folks the ability to restore the previous routing functionality used by static sites backed by VueJS (as an example).

Note that all requests routed this way will respond with a '200 OK' on the server, potentially causing SEO issues.

Closes #53
This commit is contained in:
Jose Diaz-Gonzalez
2022-08-07 19:10:31 -04:00
parent daa9549fb7
commit 89196adbf1
3 changed files with 17 additions and 3 deletions

View File

@ -23,7 +23,11 @@ http {
port_in_redirect off;
location / {
try_files $uri $uri/ =404;
{{ if ne $.NGINX_DEFAULT_REQUEST "" }}
try_files $uri $uri/ /{{ $.NGINX_DEFAULT_REQUEST }};
{{ else }}
try_files $uri $uri/ =404;
{{ end }}
}
}
}