37 lines
1.4 KiB
Plaintext
37 lines
1.4 KiB
Plaintext
# MuMuAINovel OIDC Sidecar - Platform Authentication Proxy
|
|
# Authenticates platform JWT via nginx auth_request, passes user to MuMuAINovel
|
|
server {
|
|
listen 4180;
|
|
|
|
# Platform JWT verification endpoint (internal subrequest)
|
|
auth_request /platform-auth;
|
|
auth_request_set $auth_user_id $upstream_http_x_user_id;
|
|
auth_request_set $auth_user_name $upstream_http_x_user_name;
|
|
|
|
# Proxy to MuMuAINovel
|
|
location / {
|
|
proxy_pass http://qihu-aiflow-mumuainovel:8000;
|
|
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 $scheme;
|
|
proxy_set_header X-Platform-User-Id $auth_user_id;
|
|
proxy_set_header X-Platform-User-Name $auth_user_name;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection "upgrade";
|
|
proxy_read_timeout 600s;
|
|
}
|
|
|
|
# Auth subrequest - validate platform JWT
|
|
location = /platform-auth {
|
|
internal;
|
|
proxy_pass http://qihu-aiflow:18080/app/api/auth/verify;
|
|
proxy_pass_request_body off;
|
|
proxy_set_header Content-Length "";
|
|
proxy_set_header X-Original-URI $request_uri;
|
|
proxy_set_header Authorization $http_authorization;
|
|
proxy_set_header Cookie $http_cookie;
|
|
}
|
|
}
|