413 error while pushing the repo

712 views
Skip to first unread message

slafs

unread,
Apr 23, 2012, 5:40:02 PM4/23/12
to rhod...@googlegroups.com
Got an "abort: HTTP Error 413: Request Entity Too Large" while doing

hg push http://....

My configuration involves nginx as a reverse proxy.
It happens near sending the 1900th byte (I think).

Any hints/help or should I post some configs?

Regards

Sławek

Robin Pellatt

unread,
Apr 24, 2012, 7:36:49 AM4/24/12
to rhod...@googlegroups.com
Did you mean 1900th KB?  You might want to check "client_max_body_size" in your  /etc/nginx/nginx.conf, I think the default is only 1MB which is too low for HG usage.  I set mine to "50m" which is enough for my setup.
Cheers,
Robin.

Sławek Ehlert

unread,
Apr 24, 2012, 8:37:52 AM4/24/12
to rhod...@googlegroups.com, Robin Pellatt
Hi

Did you mean 1900th KB?

Maybe ;]


 You might want to check "client_max_body_size" in your  /etc/nginx/nginx.conf, I think the default is only 1MB which is too low for HG usage.  I set mine to "50m" which is enough for my setup.


I followed the setup on rhodecode documentation and my nginx configuration looks like this:

==================

upstream rc {
    server 127.0.0.1:5000;
    # add more instances for load balancing
    #server 127.0.0.1:5001;
    #server 127.0.0.1:5002;
}

server {
   listen          80;
   server_name     hg.mga.com.pl;
   access_log      /var/log/nginx/rhodecode.access.log;
   error_log       /var/log/nginx/rhodecode.error.log;

   location /images {
        try_files $uri @static;
   }
   location /css {
        try_files $uri @static;
   }
   location /js {
        try_files $uri @static;
   }

   location / {
        #try_files $uri @static;
        try_files $uri @rhode;
   }

   location @rhode {
        proxy_pass      http://rc;
        include         /etc/nginx/proxy.conf;
   }

   location @static {
        root            /home/slafs/virtualenvs/rhodecode/lib/python2.6/site-packages/rhodecode/public;
   }
}


==================

and proxy.conf looks like this:

proxy_redirect              off;
proxy_set_header            Host $host;
proxy_set_header            X-Url-Scheme $scheme;
proxy_set_header            X-Host $http_host;
proxy_set_header            X-Real-IP $remote_addr;
proxy_set_header            X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header            Proxy-host $proxy_host;
client_max_body_size        400M;
client_body_buffer_size     128k;
proxy_buffering             off;
proxy_connect_timeout       7200;
proxy_send_timeout          7200;
proxy_read_timeout          7200;
proxy_buffers               8 32k;


===============


So I think that the setting client_max_body_size should be OK.

Regards

Sławek

slafs

unread,
Apr 24, 2012, 5:26:22 PM4/24/12
to rhod...@googlegroups.com
OK. Got it!

including proxy.conf isn't sufficient on the location level. Moved it to the server level and now it's OK.

This is kind of a documentation issue I think. http://packages.python.org/RhodeCode/setup.html#nginx-virtual-host-example doesn't seem to work for me on Nginx 0.7.65.

Cheers
Reply all
Reply to author
Forward
0 new messages