I understand that I can set a file for a custom error page:
location / {
error_page 404 = /mybad.html;
}
But I'd just like to instead provide my page override as text inline in the config file:
location / {
error_page 404 = "<H1>Sorry!</H1>"
}
Is this possible with nginx?
location / {
error_page 404 @sorry;
}
location @sorry {
return 404 "<H1>Sorry!</H1>";
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With