skip to Main Content

I am working with Magento 2.4.2 (Adobe Commerce Enterprise Edition) and have a local site set up using the Magento Cloud Docker setup. I would like to change the nginx timeout setting to be long enough to let a page I’m testing run for as long as it needs to but still render the page on the browser in the frontend.

Is there a specific environment variable that I can set in my docker-compose.yml file to accomplish this? I’m not seeing anything that would make this update in the docker-environment or Dockerfile files. Do I just have to add my own custom lines to either of these files to update the timeout setting?

2

Answers


  1. Chosen as BEST ANSWER

    According to Adobe Commerce support, this isn't possible on their Cloud platform which is very unfortunate

    In terms of a local environment for testing, a method which is quicker and hackier than the one presented by Deki above is below:

    ssh into your tls docker container edit the /etc/nginx/conf.d/default.conf file as per below:

    server { listen 80; listen 443 ssl;

    server_name _;
    
    ssl_certificate /etc/nginx/ssl/magento.crt;
    ssl_certificate_key /etc/nginx/ssl/magento.key;
    
    **# Add the 3 lines below**
    proxy_read_timeout NEW_TIMEOUT_VALUE;
    proxy_connect_timeout NEW_TIMEOUT_VALUE;
    keepalive_timeout NEW_TIMEOUT_VALUE;
    
    location / {
        proxy_pass http://varnish:80;
        proxy_set_header Host $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-Proto $scheme;
        proxy_buffer_size 128k;
        proxy_buffers 4 256k;
        proxy_busy_buffers_size 256k;
    }
    

    }


  2. if you use magento cloud docker development, no you can’t without overriding the docker image.

    if you want to set nginx timeout, you need to override the nginx docker image and include it in docker-compose.override.yml. here are the step :

    1. copy vendor/magento/magento-cloud-docker/images/nginx to .docker/images/nginx, i.e like this
    2. edit .docker/images/nginx/1.19/etc/nginx.conf and .docker/images/nginx/1.19/etc/vhost.conf
    3. create docker-compose.override.yml , like this
    4. and run docker-compose up --build --force-recreate --no-deps --remove-orphans -d

    check this link for the full example.

    Note : the .docker/config.env file will be overwritten when you run ./vendor/bin/ece-docker 'build:compose'

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search