7
submitted 13 hours ago by gyoo@lemmy.ca to c/selfhosted@lemmy.world

I am trying to increase the upload limit on my matrix server. I would like to push it to 500MB, but it keeps failing the upload past ~180MB. There is very little information about the failure, the client just says "Unkown error", nginx says "error 499", which means the client disconnected to quickly. Additionally, trying to recreate the failure with curl just results in a success, so the issue seems to be with the client. I tried with element-web, element desktop, element x and cinny and they all have this issue.

I run a continuwuity server on a Raspberry Pi 4B, behind two nginx reverse proxies and a rathole tunnel. Continuwuity, and the two reverse proxies run inside docker compose projects. Here is my architecture :

                   __
                 .(  ).
               (`Cloud )
                `-----`
                   |
                   V
          +- Outside server -+
          |   +---------+    |
          |   | rathole |    |
          |   +---------+    |
          +--------|---------+
                   |
+- Home network ---|-------------------------+
| +- RasPi --------|-----------------------+ |
| |                V                       | |
| |       +- tunnel docker -+              | |
| |       | +---------+     |              | |
| |       | | nginx 1 |     |              | |
| |       | +---------+     |              | |
| |       +-----|-|---------+              | |
| |             | |                        | |
| |             | +- other services -->... | |
| |             |                          | |
| |             V                          | |
| |       +- matrix docker --+             | |
| |       |   +---------+    |             | |
| |       |   | nginx 2 |    |             | |
| |       |   +---------+    |             | |
| |       |        |         |             | |
| |       | +------V-------+ |             | |
| |       | | Continuwuity | |             | |
| |       | +--------------+ |             | |
| |       +------------------+             | |
| +----------------------------------------+ |
+--------------------------------------------+

Of course, I made sure to increase the upload limit in Continuwuity :

max_request_size = 500000000

And in both nginx instances :

client_max_body_size 500M;

From what I can gather from other issues on the internet, it seems it could be related to timeout errors. Although they all seem to be talking about 2-8Gb files, I am probably running much weaker hardware than they do, so it checks out.

I tried setting the following values in both nginx instances :

location / {
    proxy_connect_timeout       600;
    proxy_send_timeout          600;
    proxy_read_timeout          600;
    send_timeout                600;
    proxy_next_upstream         off;
    proxy_buffering             off;

    proxy_pass ...;
}

And setting timeout values in Continuwuity :

client_receive_timeout = 75
client_request_timeout = 180
client_response_timeout = 120
client_shutdown_timeout = 10

Since that didn't have any effect, I bumped them by 20x and 40x respectively :

location / {
    proxy_connect_timeout       18000;
    proxy_send_timeout          18000;
    proxy_read_timeout          18000;
    send_timeout                18000;
    proxy_next_upstream         off;
    proxy_buffering             off;

    proxy_pass ...;
}
client_receive_timeout = 3000
client_request_timeout = 7200
client_response_timeout = 4800
client_shutdown_timeout = 400

But that did not have any effect. I also looked at modifying element-web's settings, but there doesn't seem to be anything related to timeouts.

I also saw that encrypted vs. unencrypted rooms might have an effect, but I got ~190MB max in encrypted rooms and ~180MB in unencrypted rooms.

Finally, I tried using curl :

curl -X POST https://server.domain/_matrix/media/v3/upload -H "Authorization: Bearer <token>" -H "Content-Type application/octet-stream" --data @200mb.file
# success
# returns a mxc:// url
curl -X POST https://server.domain/_matrix/client/v1/media/download/server.name/file_id -H "Authorization: Bearer <token>" -o 200mb_copy.file
# See that the two files are identical

I am at a loss. What can I do to solve this issue?

you are viewing a single comment's thread
view the rest of the comments
[-] stratself@lemdro.id 4 points 7 hours ago

Why is there two nginx containers? Can you do nginx1 --> continuwuity?

Does continuwuity show any logs? What about nginx? Check Element Web's devtools, does the 499'd network request say anything of note?

Maybe have a chat in the support room

this post was submitted on 10 Jun 2026
7 points (100.0% liked)

Selfhosted

59799 readers
460 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

  1. Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don't duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

  7. No low-effort posts. This is subjective and will largely be determined by the community member reports.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 3 years ago
MODERATORS