我尝试将提交从IntelliJ IDEA
推送到远程。我在处理过程中收到以下错误消息:
Delta compression using up to 4 threads.
Total 420 (delta 199), reused 0 (delta 0)
The remote end hung up unexpectedly
The remote end hung up unexpectedly
RPC failed; HTTP 413 curl 22 The requested URL returned error: 413 Request Entity Too Large
我将Nginx
用作反向代理,并进行以下配置,我也设置了限制:
cat /etc/nginx/sites-available/git
upstream gitea {
server 127.0.0.1:3000;
}
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name example.com;
root /var/lib/gitea/public;
access_log off;
error_log off;
location / {
try_files maintain.html $uri $uri/index.html @node;
}
location @node {
client_max_body_size 0;
max_input_time = 480000;
max_execution_time = 480000;
upload_max_filesize = 240000M;
post_max_size = 480000M;
memory_limit = 240000M;
proxy_pass http://localhost:3000;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_max_temp_file_size 0;
proxy_redirect off;
proxy_read_timeout 120;
}
}
我也增加了git
中postBuffer的大小,但是错误仍然存在。
git config --global http.postBuffer 157286400