This documentation page is for configuring the error pages to custom ones using some HTML files.
Table of Contents
-
Go to application.yaml and add these new lines:
server:
error:
whitelabel:
enabled: false
-
In security.yaml or application.yaml check if these lines are added so that you can configure the error pages from the datadir:
spring: thymeleaf: prefix: file:${georchestra.datadir}/gateway/templates/
-
In the datadir create a folder from the root directory: "gateway/templates/error"
-
Place your error page files named as per the status code. For example for 404: 404.html
-
Restart georchestra gateway.
Custom error pages can also be used when an application behind the gateways returns an error.
To enable it globally, add this to application.yaml :
spring: cloud: gateway: default-filters: - ApplicationError
To enable it only on some routes, add this to concerned routes in routes.yaml :
filters: - name: ApplicationError