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:
@ -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 }}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user