Files
goma-gateway/docs/middleware/access.md
2024-11-09 15:06:09 +01:00

712 B

title, layout, parent, nav_order
title layout parent nav_order
Access default Middleware 2

Access Middleware

Access middleware prevents access to a route or specific route path.

Example of access middleware

  # The server will return 403
  - name: api-forbidden-paths
    type: access
    ## prevents access paths
    paths:
      - /swagger-ui/*
      - /v2/swagger-ui/*
      - /api-docs/*
      - /internal/*
      - /actuator/*

Apply access middleware on the route

  routes:
    - name: Basic auth
      path: /protected
      rewrite: /
      destination: 'https://example.com'
      methods: [POST, PUT, GET]
      healthCheck:
      cors: {}
      middlewares:
        - api-forbidden-paths