Skip to content

Instantly share code, notes, and snippets.

@lovasoa
Created March 10, 2026 09:24
Show Gist options
  • Select an option

  • Save lovasoa/74de94a81829c255d5f4c6a81b7af4c2 to your computer and use it in GitHub Desktop.

Select an option

Save lovasoa/74de94a81829c255d5f4c6a81b7af4c2 to your computer and use it in GitHub Desktop.
Minimal Linux/docker repro for actix-web issue 3967

Minimal repro for actix/actix-web#3967

This repro uses:

  • a minimal actix-http server that returns 200 OK without reading the request body
  • nginx with proxy_request_buffering on

Run

docker compose up --build

In another shell:

dd if=/dev/zero bs=1m count=512 2>/dev/null | curl -v --http1.1 --data-binary @- http://127.0.0.1:18081/

Expected result

curl receives:

HTTP/1.1 100 Continue
HTTP/1.1 502 Bad Gateway

nginx logs:

writev() failed (32: Broken pipe) while sending request to upstream
[package]
name = "issue3967-minimal"
version = "0.1.0"
edition = "2021"
[dependencies]
actix-http = "3.12"
actix-rt = "2.11"
actix-server = "2.6"
services:
server:
build:
context: .
dockerfile: Dockerfile.server
nginx:
image: nginx:1.29
depends_on:
- server
ports:
- "18081:80"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
FROM rust:1.91-bookworm AS build
WORKDIR /app
COPY Cargo.toml Cargo.lock* ./
COPY src ./src
RUN cargo build --release
FROM debian:bookworm-slim
WORKDIR /app
COPY --from=build /app/target/release/issue3967-minimal /usr/local/bin/issue3967-minimal
EXPOSE 8080
CMD ["/usr/local/bin/issue3967-minimal"]
use std::{convert::Infallible, io};
use actix_http::{HttpService, Request};
use actix_server::Server;
async fn handler(_req: Request) -> Result<&'static str, Infallible> {
Ok("ok")
}
#[actix_rt::main]
async fn main() -> io::Result<()> {
let factory = || HttpService::build().finish(handler).tcp();
Server::build()
.bind("issue3967", ("0.0.0.0", 8080), factory)?
.run()
.await
}
worker_processes 1;
events {
worker_connections 1024;
}
http {
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log info;
proxy_request_buffering on;
client_body_buffer_size 10m;
client_max_body_size 5g;
server {
listen 80;
location / {
proxy_http_version 1.1;
proxy_pass http://server:8080;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment