fix(infra): use proxy_pass for API gateway to support gRPC-web
grpc_pass only handles native gRPC (HTTP/2 frames). The web dashboard uses gRPC-web via Connect protocol (HTTP/1.1 POST requests). Switch api.fxhnt.ai nginx block to proxy_pass so tonic_web::GrpcWebLayer on the API service can handle the protocol conversion. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -233,7 +233,8 @@ data:
|
||||
}
|
||||
}
|
||||
|
||||
# API Gateway (gRPC) — api.fxhnt.ai
|
||||
# API Gateway (gRPC-Web + gRPC) — api.fxhnt.ai
|
||||
# Browser dashboard uses gRPC-web (HTTP/1.1 POST), so proxy_pass not grpc_pass
|
||||
server {
|
||||
listen 443 ssl;
|
||||
http2 on;
|
||||
@@ -244,10 +245,15 @@ data:
|
||||
ssl_protocols TLSv1.2 TLSv1.3;
|
||||
|
||||
location / {
|
||||
grpc_pass grpc://api.foxhunt.svc.cluster.local:50051;
|
||||
grpc_read_timeout 3600s;
|
||||
grpc_send_timeout 3600s;
|
||||
grpc_connect_timeout 30s;
|
||||
proxy_pass http://api.foxhunt.svc.cluster.local:50051;
|
||||
proxy_set_header Host $http_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;
|
||||
proxy_http_version 1.1;
|
||||
proxy_read_timeout 3600s;
|
||||
proxy_send_timeout 3600s;
|
||||
proxy_connect_timeout 30s;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user