GitLab behind Apache reverse proxy: Error uploading file. Please try again

When I try to upload a file to a GitLab repository it says “Error uploading file. Please try again.”
I am able to upload files through the Web IDE just fine.
Any help is appreciated.

Browser console:

Failed to load resource: the server responded with a status of 500 (Internal Server Error)

Gitlab error log in Apache:

[Thu Apr 27 08:53:57.885838 2023] [proxy_http:error] [pid 175146] [client] AH01097: pass request body failed to ( from (), referer:
[Thu Apr 27 08:53:57.914247 2023] [proxy:error] [pid 175146] (104)Connection reset by peer: [client] AH01084: pass request body failed to (, referer:

Apache virtual host:

SetEnv nokeepalive ssl-unclean-shutdown

SSLEngine on
#strong encryption ciphers only
#see ciphers(1)
SSLProtocol all -SSLv2
SSLHonorCipherOrder on
Header add Strict-Transport-Security: "max-age=15768000;includeSubsowgro.nets"
SSLCompression Off

Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/
SSLCertificateKeyFile /etc/letsencrypt/live/
SSLCACertificateFile /etc/letsencrypt/live/
ServerSignature Off
ProxyPreserveHost On

# Ensure that encoded slashes are not decoded but left in their encoded state.
AllowEncodedSlashes NoDecode

<Location />
    # New authorization commands for apache 2.4 and up
    Require all granted

    #Allow forwarding to gitlab-workhorse

# Apache equivalent of nginx try files
RewriteEngine on

#Forward all requests to gitlab-workhorse except existing files like error documents
RewriteCond %{REQUEST_URI} ^/uploads/.*
RewriteRule .*{REQUEST_URI} [P,QSA,NE]

RequestHeader set X_FORWARDED_PROTO 'https'
RequestHeader set X-Forwarded-Ssl on

# needed for downloading attachments
DocumentRoot /home/git/gitlab/public

#Set up apache error documents, if back end goes down (i.e. 503 error) then a maintenance/deploy page is thrown up.
ErrorDocument 404 /404.html
ErrorDocument 422 /422.html
ErrorDocument 500 /500.html
ErrorDocument 502 /502.html
ErrorDocument 503 /503.html

LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b" common_forwarded

ErrorLog /var/log/apache2/gitlab_error.log
CustomLog /var/log/apache2/gitlab_forwarded.log common_forwarded
CustomLog /var/log/apache2/gitlab_access.log combined env=!dontlog
CustomLog /var/log/apache2/gitlab_SERVER_FQDN.log combined


puma['worker_processes'] = 0
prometheus_monitoring['enable'] = false
sidekiq['max_concurrency'] = 10
external_url ''
gitlab_rails['trusted_proxies'] = ['']
gitlab_rails['allowed_hosts'] = ['']
gitlab_workhorse['listen_network'] = "tcp"
gitlab_workhorse['listen_addr'] = ""
web_server['external_users'] = ['www-data']
nginx['enable'] = false
nginx['listen_port'] = 8081
nginx['listen_https'] = false