Error: "We received an unexpected status code from the server (413)"

When you receive this message when uploading a file it may be that you’re running on an AWS docker instance where Ngnix is configured to reject requests over 1MB.

I’m using matttermost with the gitlab-ce package on Debian.
I’ve set nginx[‘client_max_body_size’] = ‘500m’ and mattermost_nginx[‘client_max_body_size’] = “500m” in /etc/gitlab.rb, however after a reconfiguration I still get a 413 error. Any idea?

You might confirm that Nginx has the proper setting (vs the gitlab configuration). You should see client_max_body_size 500M; in the config. The config usually can be found under /etc/nginx/sites-enabled.

1 Like

This worked for me. Thanks