mirror of
https://github.com/langflow-ai/langflow.git
synced 2026-07-23 21:48:22 +08:00
fix(docker): force HTTP/1.1 on frontend nginx upstream proxy The frontend nginx config proxied to the backend without setting proxy_http_version, so nginx used its default of HTTP/1.0 for the upstream requests. Behind an HTTP/1.1-only proxy (e.g. an Istio/Envoy service-mesh sidecar) those requests are rejected with HTTP 426 Upgrade Required, breaking /api, /health, and /health_check. Set proxy_http_version 1.1 explicitly on every proxy_pass block in both default.conf.template (rendered into the production frontend image) and nginx.conf. This is version-independent and keeps working regardless of which nginx the image ships (the image pins nginx 1.28.0, whose upstream default is still HTTP/1.0). Verified with the pinned nginx image in front of an HTTP/1.1-only mock upstream: /api, /health, /health_check return 200 and nginx forwards upstream as HTTP/1.1 (was 426 / HTTP/1.0 before the fix). Fixes #9010
34 lines
766 B
Nginx Configuration File
34 lines
766 B
Nginx Configuration File
server {
|
|
gzip on;
|
|
gzip_comp_level 2;
|
|
gzip_min_length 1000;
|
|
gzip_types text/xml text/css;
|
|
gzip_http_version 1.1;
|
|
gzip_vary on;
|
|
gzip_disable "MSIE [4-6] \.";
|
|
|
|
listen __FRONTEND_PORT__;
|
|
|
|
location / {
|
|
root /usr/share/nginx/html;
|
|
index index.html index.htm;
|
|
try_files $uri $uri/ /index.html =404;
|
|
expires 1d;
|
|
add_header Cache-Control "public";
|
|
}
|
|
location /api {
|
|
proxy_pass __BACKEND_URL__;
|
|
proxy_http_version 1.1;
|
|
}
|
|
location /health_check {
|
|
proxy_pass __BACKEND_URL__;
|
|
proxy_http_version 1.1;
|
|
}
|
|
location /health {
|
|
proxy_pass __BACKEND_URL__;
|
|
proxy_http_version 1.1;
|
|
}
|
|
|
|
include /etc/nginx/extra-conf.d/*.conf;
|
|
}
|