nginx Reverse Proxy in front of apache webdav upload file Problems

reredok
reredok used Ask the Experts™
on
In a nutshell:
I use an apache2 as webdav server and have a nginx reverse proxy in front of it.
The download of larger files (~ 6 GB) works without problems only the upload of larger files (already from 450 MB) aborts exactly at the EOF with the error message "65 client intended to send too large body " (on nginx).

I tested all possible settings like client_max_body_size, proxy_buffering off; unfortunately without success. If I run apache2 without nginx reverse proxy everything works as expected.

Thanks for your help

reredok
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Ravi Kumar AtreyCloud Specialist- Azure

Commented:
You need to configure upload size at every level, like in configuration of your application platform like if application is in php then it should be configured in PHP.ini file, then ngnix configuration and then apach's configuration.

Then you need to try.

Please do this and let me know if you have already done?
reredokIT Consultant

Author

Commented:
except for the configuration of php I configured it in nginx and apache2.
Ravi Kumar AtreyCloud Specialist- Azure

Commented:
Please do in PHP configuration as well.

upload_max_filesize=
post_max_size=
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

reredokIT Consultant

Author

Commented:
php isn't installed: neither on the nginx nor apache server
Ravi Kumar AtreyCloud Specialist- Azure

Commented:
ok.. so how are you trying to upload, I mean what you are using to upload files, directly under your application or any some ftp sort of tool?
David FavorFractional CTO
Distinguished Expert 2018

Commented:
Increasing client_max_body_size should fix this.

Likely best to install inotify-wait tools + watch all your config files. Then restart NGINX + ensure config file where you added the client_max_body_size change is actually read when NGINX restarts.
reredokIT Consultant

Author

Commented:
@Ravi Kumar Atrey
Sorry, my information was a quick shot again.
Apache2 runs "of course" a webdav and nginx serves as an accelerator

@David Favor
client_max_body_size 2G; 20G; 200G; (nginx.conf, ../site-available/reserve-proxy.conf)
I tested in scope locaction, server, http and so on.

It must actually cause nginx the problem there without, so apache2 "alone" with webdav does not have the problem.
Prabhin MPDevOps Engineer
Distinguished Expert 2018

Commented:
client_max_body_size        50m;

check this , this should solve the issue
reredokIT Consultant

Author

Commented:
here you will find further information. Unfortunately the upload to the webdav (apache2) via nginx still does not work.

monitoring filesaccess nginx:
/etc/nginx/nginx.conf OPEN
/etc/nginx/nginx.conf ACCESS
/etc/nginx/sites-available/reverse-proxy.conf OPEN
/etc/nginx/sites-available/reverse-proxy.conf ACCESS
/etc/nginx/sites-available/reverse-proxy.conf CLOSE_NOWRITE,CLOSE
/etc/nginx/nginx.conf CLOSE_NOWRITE,CLOSE

client_max_body_size in nginx files (client_max_body_size 50G;)
grep -ril 'client_max_body_size' /etc/nginx
/etc/nginx/sites-available/reverse-proxy.conf
/etc/nginx/nginx.conf

webdav-client-error
webdav-client (carot-dav)

/var/log/nginx/error.log
2019/01/18 08:17:32 9987#9987: *27 client intended to send too large body: 104857600 bytes, client: 37.209.113.138, server: ......., request: "PUT /webdav/DATEV/KassenundWarenerfassung/test/K$ ....
David FavorFractional CTO
Distinguished Expert 2018

Commented:
You said, "I tested in scope locaction, server, http and so on."

Using inotifywait to verify the files your changing are actually be re-ingested, based on however you're restarting all your services.
Fractional CTO
Distinguished Expert 2018
Commented:
Tip: NGINX as an accelerator. Rarely does this actually occur.

Tip: For WebDav access, all caching/acceleration should be disabled, as caching will either slow WebDav to a crawl (much duplicate i/o) or completely break your WebDav access (as you'll be working on cached copies of files, rather than real copies).

If only one person is using WebDav, NGINX will just slow down access.

If many people are attempting to access the same resource, you'll likely end up with all manner of subtle problems where people are seeing + changing various versions of data.

I always use raw Apache, to keep my life simple.

If you're using the Apache 2.4 branch, then you'll be surprised how much faster Apache runs over NGINX, if you actually speed test every layer of your LAMP Stack.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial