go-gitea/gitea

releases.attachment Request Entity Too Large

Closed this issue · 3 comments

Gitea version 8006b1b

Platform: Debian GNU/Linux 9

I want to publish a go compilation file of 1.8M, upload failed

error message:

<html>
 <head><title>413 Request Entity Too Large</title></head>
 <body bgcolor="white">
 <center><h1>413 Request Entity Too Large</h1></center>
 <hr><center>nginx/1.10.3</center>
 </body>
 </html>
 <!-- a padding to disable MSIE and Chrome friendly error page -->
 <!-- a padding to disable MSIE and Chrome friendly error page -->
 <!-- a padding to disable MSIE and Chrome friendly error page -->
 <!-- a padding to disable MSIE and Chrome friendly error page -->
 <!-- a padding to disable MSIE and Chrome friendly error page -->
 <!-- a padding to disable MSIE and Chrome friendly error page -->

app.ini

[attachment]
ENABLED        = true
ALLOWED_TYPES  = */*
MAX_SIZE       = 200
MAX_FILES      = 100

That error appears to be coming from nginx not Gitea.

Is it possible that nginx is rejecting the upload?

Thank you.

I added the following to nginx

client_header_timeout 120s;         
client_body_timeout 120s;           
client_max_body_size 200m;   

NginX as a reverse proxy
If you are using multiple domains / web services on the same server (port 80), the request must be redirected to the appropriate service / port. For this you use reverse proxy. My NginX works here on an arched box.

server {
    listen 80;
    server_name git.xxxx.de;
    client_max_body_size 100M; # Push large objects to gitea

    location / {
        proxy_pass http://127.0.0.1:3000;
    }
}