Add /agents/ location block to nginx config to proxy agent heartbeat requests directly to backend API without /api/v1 prefix duplication, implement normalized_api_url helper to detect and fix double /api/v1 suffixes in agent config with automatic /api/v1 appending when missing, enhance heartbeat error logging to include HTTP status codes, response body preview, and resolved API URL for debugging connection
32 lines
828 B
Plaintext
32 lines
828 B
Plaintext
server {
|
|
listen 80;
|
|
server_name _;
|
|
|
|
location /api/ {
|
|
proxy_pass http://api:8000/api/;
|
|
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-Host $http_host;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
}
|
|
|
|
location /agents/ {
|
|
proxy_pass http://api:8000/api/v1/agents/;
|
|
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-Host $http_host;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
}
|
|
|
|
location /healthz {
|
|
proxy_pass http://api:8000/healthz;
|
|
}
|
|
|
|
location / {
|
|
proxy_pass http://frontend:80;
|
|
proxy_set_header Host $http_host;
|
|
}
|
|
}
|