Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nginx make client_max_body_size configurable. #52

Open
jan-thoma opened this issue Dec 2, 2021 · 2 comments
Open

Nginx make client_max_body_size configurable. #52

jan-thoma opened this issue Dec 2, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@jan-thoma
Copy link

Description

The nginx image sets a client_max_body_size of 25MB. Trying to upload files bigger than 25MB results in a error 413. Setting the Env Vars:

PHP_POST_MAX_SIZE=64M
PHP_UPLOAD_MAX_FILESIZE=64M

is not enough to circumvent this problem. The only solution at the moment is to bindmount

/etc/nginx/nginx.conf or /etc/nginx/conf.d/default.conf

which could lead to errors when images are updated and changes their config. Adding client_max_body_size to the default.conf server block and make configurable with Env Vars as in the description of the nginx docker image could solve this.

https://hub.docker.com/_/nginx

Steps to reproduce

  1. Install Craft with the nginx image
  2. Try to upload a file bigger than 25MB

Additional info

  • Docker Image: craftcms/nginx:7.4
@jan-thoma jan-thoma added the bug Something isn't working label Dec 2, 2021
@ralftar
Copy link

ralftar commented May 22, 2022

Try something like this in your Dockerfile:

RUN sed -i 's/client_max_body_size 25M;/client_max_body_size 64M;/g' /etc/nginx/nginx.conf

@mihob
Copy link

mihob commented Mar 22, 2023

Any news on this topic?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants