Skip to content

Latest commit

 

History

History
53 lines (41 loc) · 1.21 KB

custom-error-pages.adoc

File metadata and controls

53 lines (41 loc) · 1.21 KB

Customize error pages

This documentation page is for configuring the error pages to custom ones using some HTML files.

Customize error pages

  1. Go to application.yaml and add these new lines:

server:
  error:
    whitelabel:
      enabled: false
  1. 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/
  1. In the datadir create a folder from the root directory: "gateway/templates/error"

  2. Place your error page files named as per the status code. For example for 404: 404.html

  3. Restart georchestra gateway.

Using custom error pages for applications errors

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