From f4d1211d417ef9239470803c89c7ccf45fdd9134 Mon Sep 17 00:00:00 2001 From: Ravi Pendurty Date: Thu, 8 May 2025 10:59:48 +0530 Subject: [PATCH] Fix 401 unauthorized issue while accessing apidoc Issue-ID: OAM-454 Change-Id: I71927e095c0fb019abf590a5152bd1fae0626f4f Signed-off-by: Ravi Pendurty --- solution/smo/oam/odlux/location.rules | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/solution/smo/oam/odlux/location.rules b/solution/smo/oam/odlux/location.rules index 97a3541..f4bd582 100644 --- a/solution/smo/oam/odlux/location.rules +++ b/solution/smo/oam/odlux/location.rules @@ -29,6 +29,16 @@ location /websocket { proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } +location /apidoc/ { + proxy_pass http://controller:8181; + + # Inject Authorization header + proxy_set_header Authorization "Bearer $cookie_token"; + # + # Optional CORS settings + #add_header Access-Control-Allow-Origin *; + add_header Access-Control-Allow-Headers Authorization,Content-Type; +} location @backend { proxy_pass http://controller:8181; -} \ No newline at end of file +} -- 2.16.6