mirror of
https://github.com/langflow-ai/langflow.git
synced 2026-07-24 05:39:16 +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
55 lines
1.3 KiB
Plaintext
55 lines
1.3 KiB
Plaintext
worker_processes auto;
|
|
pid /tmp/nginx.pid;
|
|
events {}
|
|
|
|
http {
|
|
include /etc/nginx/mime.types;
|
|
default_type text/plain;
|
|
client_max_body_size ${LANGFLOW_MAX_FILE_SIZE_UPLOAD}M;
|
|
|
|
types {
|
|
text/html html;
|
|
text/css css;
|
|
application/javascript js;
|
|
}
|
|
|
|
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 = /index.html {
|
|
root /usr/share/nginx/html;
|
|
add_header Cache-Control "no-cache, no-store, must-revalidate";
|
|
etag on;
|
|
}
|
|
|
|
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;
|
|
}
|
|
} |