Problem with client_max_body_size

dast@c-base dast at c-base.org
Tue Feb 5 14:08:03 UTC 2013


Hi,

i want to use Nginx with apache2 and mod_dav_svn for hosting my SVN Repository via https.

But i have problems on commit large files.

On a 8MB ffmpeg binary commit, my SVN client brings this error:
Commit failed (details follow):
Server sent unexpected return value (413 Request Entity Too Large) in response to PUT request for '/svn/repo1/!svn/wrk/b2f0560a-05fd-427c-9039-d47dea9ff9c4/path/ffmpeg'


The Nginx error log says:


2013/02/05 14:20:25 [error] 22931#0: *2693 client intended to send too large body: 8309431 bytes, client: 93.220.123.123, server: mydomain.com, request: "PUT /svn/repo1/!svn/wrk/b2f0560a-05fd-427c-9039-ababea9ff9c4/path/ffmpeg HTTP/1.1", host: "mydomain.com"


And nothing about the request in the apache logs.
So i think the nginx blocks the request, not the proxy to apache.


The Requests to the Nginx goes over HTTPS:

https://public-domain.com/svn/ (nginx)     <>    routing to http://localhost:8080  (apache2)


My Nginx config already has client_max_body_size 256M; in the nginx.conf inside http { } and server { } in the vost site config.
But it does not helps or is ignored.

i have searched all other nginx configfiles for "client_max_body_size" without succes:

#> grep -R 'client_max_body_size' ./*
./nginx.conf:   client_max_body_size    256M;
./sites-available/443_mydomain.com:      client_max_body_size    256M;
./sites-available/443_mydomain.com:      client_max_body_size    256M;
./sites-enabled/443_mydomain.com:        client_max_body_size    256M;
./sites-enabled/443_mydomain.com:        client_max_body_size    256M;


my site config file:


server {
	listen   443;
	server_name mydomain.com;

	client_max_body_size    256M;

	ssl    on;
	ssl_certificate    	/path/ssl-cert/nginx/mydomain.com.2013-01.cacert.crt;
	ssl_certificate_key     /path/ssl-cert/nginx/mydomain.com.2013-01.key;

	access_log /path/logs/nginx.https.mydomain.com.access.log;
	error_log /path/logs/nginx.https.mydomain.com.error.log debug;

	root /path/htdocs/mydomain.com;
	index index.php index.html;

	location / {
	    try_files $uri $uri/ /index.php;
	}

	location /svn {
	    client_max_body_size    256M;
	    keepalive_timeout  60;
	    include         /etc/nginx/proxy_params;
	    proxy_pass      http://127.0.0.1:8080;
	    set  $dest  $http_destination;
	    if ($http_destination ~ "^https://(.+)") {
	       set  $dest   http://$1;
	    }
	    proxy_set_header  Destination   $dest;
	}

}


So, what can i check?
What is wrong in my config?
Why is client_max_body_size ignored?
Does client_max_body_size not work on https?
Does client_max_body_size not work on PUT requests?

After 2 days of testing i hav no idea that to check. :(

best regards,
Daniel.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20130205/d982adfb/attachment.html>


More information about the nginx mailing list