Dockerfile icon indicating copy to clipboard operation
Dockerfile copied to clipboard

client_max_body_size in conf.d overwritten by vhost.common.d/10-general.conf

Open UeliDeSchwert opened this issue 7 years ago • 4 comments

Hey there

I just spent a few hours trying to increase the client_max_body_size, but it always stayed at around 50M.

I tried to set the variable by mounting a .conf-file to /opt/docker/etc/nginx/conf.d.

Using nginx -T i created a dump of the generated config. There I saw that my file was being loaded, but further down the line the file /opt/docker/etc/nginx/vhost.common.d/10-general.conf was loaded and the only content of this file is client_max_body_size 50M;.

This means, it is in the current latest version not possible to increase the client_max_body_size unless one overwrites the mentioned file 10-general.conf by mounting another one on top.

I don't think this is intended behaviour, because it is not mentioned anywhere in the docs. Is there any reason why this file exists or sets a body size, thereby overwriting the server wide body size config?

I only used three relevant environment variables: WEB_DOCUMENT_ROOT=/app/public PHP_POST_MAX_SIZE=500M PHP_UPLOAD_MAX_FILESIZE=500M

But I don't think that any of these settings should create this file.

The image is the current latest with hash 59c1c87c3474.

Thanks for an answer and thank you for the great work. If you need more information, just contact me.

UeliDeSchwert avatar Sep 02 '19 10:09 UeliDeSchwert

This has been introduced 2 years ago by @mblaschke and has never been re-thought until now. I think it makes sense to introduce a new variable to configure the client_max_body_size in nginx.

htuscher avatar Sep 02 '19 10:09 htuscher

I just ran into this issue and I'm looking for a solution. Is the only work around to ovewrwrite the entire file?

drmmr763 avatar Jun 10 '20 15:06 drmmr763

Yes it is. I didn't have time yet to build a variable for it.

Von unterwegs gesendet

Chad Windnagle [email protected] schrieb am Mi., 10. Juni 2020, 17:35:

I just ran into this issue and I'm looking for a solution. Is the only work around to ovewrwrite the entire file?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/webdevops/Dockerfile/issues/321#issuecomment-642089187, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABGXLBEQUO6L33Q43OVTXILRV6R5PANCNFSM4IS32IPA .

htuscher avatar Jun 10 '20 17:06 htuscher

My project in google could platform k8s env.I use command to ovewrwrite the /opt/docker/etc/nginx/vhost.common.d/10-php.conf file , add nginx params,and the pod can not running. What have I do?

h1100e avatar Jun 30 '20 06:06 h1100e