## Subversion, Apache, nginx and "Entity Too Large"

This one took me a while to track down. My brother uses my subversion repository, and he was trying to commit a 1MB flash file. The TortoiseSVN error he got back was:

None of these were my problem.

It turns out I needed to add another keyword to my search. After I searched for svn apache nginx "entity too large", the first hit took me home. Like everyone else who is awesome, I'm using nginx as a proxy to Apache running mod_dav. nginx's configuration was getting hit first, and Apache and Subversion had nothing to do with anything.

It turns out the default maximum request body size for nginx is 1MB, exactly the size my brother was trying commit to the repository. Adding this one line in my virtual host solved it all:

server {
listen 80;
server_name svn.tommymontgomery.com;

client_max_body_size 10m;

location / {
proxy_set_header Host $host; proxy_set_header X-Forwarded-Host$host;
proxy_set_header X-Forwarded-Server $host; proxy_set_header X-Forwarded-For$proxy_add_x_forwarded_for;
proxy_pass http://svn.tommymontgomery.com:8080;
}
}