-
Notifications
You must be signed in to change notification settings - Fork 520
Expand file tree
/
Copy pathnginx.conf
More file actions
110 lines (95 loc) · 3.87 KB
/
nginx.conf
File metadata and controls
110 lines (95 loc) · 3.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
pid /tmp/nginx.pid;
# Disable all file-based logging - send everything to stdout/stderr for container visibility
error_log /dev/stderr;
events {
worker_connections 1024;
}
http {
# Configure temp paths for OpenShift non-root compatibility
client_body_temp_path /tmp/nginx/client_temp;
proxy_temp_path /tmp/nginx/proxy_temp;
fastcgi_temp_path /tmp/nginx/fastcgi_temp;
uwsgi_temp_path /tmp/nginx/uwsgi_temp;
scgi_temp_path /tmp/nginx/scgi_temp;
# All logs go to stdout/stderr - no file-based logging
access_log /dev/stdout;
# error_log already configured at main level
log_format main '[$time_local] $remote_addr - $remote_user - $request $status $body_bytes_sent $http_referer $http_user_agent $http_x_forwarded_for';
log_format upstreamlog '[$time_local] $remote_addr - $remote_user - $server_name $host to: $upstream_addr: $request $status upstream_response_time $upstream_response_time msec $msec request_time $request_time';
upstream kagent_ui {
server 127.0.0.1:8001;
}
upstream kagent_ws_backend {
server 127.0.0.1:8081;
}
upstream kagent_backend {
server 127.0.0.1:8083;
}
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
listen 8080;
server_name localhost;
# A2A routes - extended timeouts for LLM streaming (thinking models can take >60s)
# Uses SSE (not WebSocket), so no Upgrade/Connection headers needed
location /a2a/ {
proxy_pass http://kagent_ui/a2a/;
proxy_http_version 1.1;
proxy_set_header Connection '';
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Origin $scheme://$host;
proxy_read_timeout 600s;
proxy_send_timeout 600s;
proxy_buffering off;
}
# Frontend routes
location / {
proxy_pass http://kagent_ui;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Origin $scheme://$host;
proxy_cache_bypass $http_upgrade;
}
# static health check
location /health {
return 200 'OK';
}
# Backend routes
location /api/ {
proxy_pass http://kagent_backend/api/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
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-Forwarded-Host $server_name;
proxy_cache_bypass $http_upgrade;
}
location /api/ws/ {
proxy_pass http://kagent_ws_backend/api/ws/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
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-Forwarded-Host $server_name;
proxy_read_timeout 300s;
proxy_send_timeout 300s;
proxy_buffering off;
}
}
}