NGINX configuration (keep_alive_timeout)

Hi averyone, I’m have a container with NGINX and I wanna incrase the keep alive timeout value, the default value is 65, I have already modified the Dockerfile document adding the follow enviroment variables:

ENV NGINX_PROXY_READ_TIMEOUT 300

ENV NGINX_PROXY_CONNECT_TIMEOUT 300

ENV NGINX_PROXY_SEND_TIMEOUT 300

ENV NGINX_KEEPALIVE_TIMEOUT 300

But I can’t change the value, also I added a new configuration file like this:

Dockerfile

FROM tiangolo/uwsgi-nginx-flask:python3.9

COPY ./requirements.txt /app/requirements.txt

RUN pip install --no-cache-dir --upgrade -r /app/requirements.txt

COPY nginx443.conf /etc/nginx/conf.d/

COPY ./app /app

nginx443.conf

server{
   proxy_read_timeout 300;
   proxy_connect_timeout 300;
   proxy_send_timeout 300;
}

I haven’t checked, but I would doubt that a generic image (doc) is supporting such env vars.

Are you sure the additional config file is read? Go into the container and use nginx -T to dump the current config to screen.

I had previously assigned the variables “ENV NGINX_WORKER_PROCESSES auto”
“ENV NGINX_WORKER_CONNECTIONS 65536” in another container and everything works well, then I thought that I could do the same with the KEEPALIVE_TIMEOUT variable, also I tried copy nginx443.conf file but whe I do that my container dosent run

It all depends on the image you use, what logic is implemented there. So you need to read the doc and look into the config.