alert-room-61990
11/09/2025, 9:25 AM[{"id":"api-cs-rule","version":"v0.40.9","description":"","match":{"methods":["GET","POST","PATCH","PUT","DELETE"],"url":"\u003c^/api/cs/.*$\u003e"},"authenticators":[{"handler":"cookie_session","config":null}],"authorizer":{"handler":"allow","config":null},"mutators":[{"handler":"id_token","config":null}],"errors":null,"upstream":{"preserve_host":false,"strip_path":"","url":"<http://cs-api:8080>"}}]
Then, if I try the following request:
curl -H "X-Forwarded-Proto: https" \
-H "X-Forwarded-Method: GET" \
-H "X-Forwarded-Host: localhost" \
-H "X-Forwarded-Uri: /api/cs/users/123" \
-X GET <http://localhost:4456/decisions>
It always replies with:
{
"error": {
"code": 404,
"status": "Not Found",
"message": "Requested url does not match any rules"
}
}
I have tried many variation of the rule, including:
• setting the match URL to <https://localhost/api/cs/><^.*$>alert-room-61990
11/09/2025, 9:31 AM"url": "<^https?://localhost(:443)?/api/cs/.*$>",
Not sure to understand why the entire string needs to be in a regexp (but maybe that's also the port?)alert-room-61990
11/09/2025, 9:35 AMlocation /api/cs/ {
auth_request /decisions;
auth_request_set $next_uri $upstream_http_X_Original_URI;
rewrite ^/api/cs/(.*)$ /$1 break;
proxy_pass <http://cs-api:8080>;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
}
location = /decisions {
internal;
proxy_pass <http://cs-oathkeeper:4456/decisions>;
proxy_pass_request_body off;
proxy_set_header Content-Length "";
proxy_set_header Host $http_host;
proxy_set_header X-Original-URI $request_uri;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Port $server_port;
proxy_set_header X-Forwarded-Method $request_method;
proxy_set_header X-Forwarded-Uri $request_uri;
}steep-lamp-91158
\u003c and \u003e because you need literal <>
also the url does not start with /, but with scheme, host, port, so you need at least <^.*/api/cs/.*$>alert-room-61990
11/10/2025, 11:00 AM