Skip to content
Discussion options

You must be logged in to vote

Example for my suggestion, with that all requests to /api/** must pass the auth service with 200 OK:

server {
    # ...
    api {
        base_path = "/api"
        endpoint "/**" {
            request "forwardauth" {
                url = "http://my-auth-service.local"
                # forward just the values you need
                headers = request.headers
                # or
                #body = request.body
                # or
                #form_body = request.form_body
                
                expected_status = [200]
            }
            
            proxy {
                # forward the client request to the backend service if 'forwardauth' request is successful

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@malud
Comment options

Answer selected by zzl221000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants