Upload reverse proxy issue

I’m running Nextcloud at home where my ISP blocks ports below 1024, so I’ve configured Nextcloud on port 40080. I’ve set up an Nginx server on AWS listening on ports 80 and 443, forwarding to my home on port 40080. However, I’m encountering upload errors only when trying to upload files through the proxy. Uploading works fine when accessing Nextcloud internally within my home network. Any suggestions?

server {
        listen 443;
        server_name domain.com;
    ssl_certificate /etc/letsencrypt/live/domain.com/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/domain.com/privkey.pem; # managed by Certbot

        location / {
                proxy_pass      http://myhome.com:40080;
                proxy_redirect off;

                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header X-Forwarded-Port $server_port;
                proxy_set_header X-Forwarded-Scheme $scheme;
                proxy_set_header X-Forwarded-Proto $scheme;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header Accept-Encoding "";
                proxy_set_header Host $host;

Overview page:

Security & setup warnings
It's important for the security and performance of your instance that everything is configured correctly. To help you with that we are doing some automatic checks. Please see the linked documentation for more information.

There are some errors regarding your setup.
Accessing site insecurely via HTTP. You are strongly advised to set up your server to require HTTPS instead. Without it some important web functionality like "copy to clipboard" or "service workers" will not work! For more details see the documentation ↗.
44 errors in the logs since June 14, 2024, 2:44:46 PM
The database is used for transactional file locking. To enhance performance, please configure memcache, if available. For more details see the documentation ↗.
No memory cache has been configured. To enhance performance, please configure a memcache, if available. For more details see the documentation ↗.
Your installation has no default phone region set. This is required to validate phone numbers in the profile settings without a country code. To allow numbers without a country code, please add "default_phone_region" with the respective ISO 3166-1 code of the region to your config file. For more details see the documentation ↗.
You have not set or verified your email server configuration, yet. Please head over to the "Basic settings" in order to set them. Afterwards, use the "Send email" button below the form to verify your settings. For more details see the documentation ↗.
The PHP module "imagick" in this instance has no SVG support. For better compatibility it is recommended to install it. For more details see the documentation ↗.
Please double check the installation guides ↗, and check for any errors or warnings in the log.

Check the security of your Nextcloud over our security scan ↗.

Last logs in image: