wordpressdockernginxportainer

Can't upload bigger file using Wordpress Docker and Nginx with configured Certbot


I configured Wordpress on Docker Image:

version: '2'
services:
  db:
    image: 'mysql/mysql-server:8.0'
    volumes:
      - 'db_data:/var/lib/mysql'
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: '${MYSQL_DATABASE_PASSWORD}'
      MYSQL_DATABASE: wordpress
      MYSQL_USER: wordpress
      MYSQL_PASSWORD: wordpress
  wordpress:
    image: 'wordpress:latest'
    ports:
      - 80
    restart: always
    environment:
      WORDPRESS_DB_HOST: 'db:3306'
      WORDPRESS_DB_USER: wordpress
      WORDPRESS_DB_PASSWORD: wordpress
 
volumes:
  db_data: null

and I changed max_execution to 300, upload_max_filesize to 500 time and memory_limit to 256MB correctly inside Wordpress container settings file. I checked it in php_info and looks ok.

But when I try to upload file 123MB it stopping around 30 seconds in middle always. Diffrent % usually. Im using All-In-One Migration Plugin but using others also stopping in middle.

Im using nginx as reverse proxy with configured CertBot. Im doing everything using Portainer.

I dont see any logs error or message.

What I need to do to make uploading working good?


Solution

  • I solved it. It was a problem with the Nginx configuration. I was thinking that if Nginx is only used as a reverse proxy, then it did not have too much to talk but that was not true.

    The solution was to add this to the configuration of my domain inside /etc/nginx/conf.d/CONFIGFILE.conf, inside location {}.

    proxy_connect_timeout 300;
    proxy_send_timeout 300;
    client_max_body_size 500M;