I own a VPS (ubuntu 20.04) running a VPN via Wireguard (1.0.20200513) and an Apache (2.4.41) web server, and I have a machine connected to this VPN running nextcloud (docker).
The issue is that whenever i try to upload a file greater than 2-2.5GB it will hang and I won't be able to reach my server for the next 15-20 min. At first I thought it may be the reverse proxy, but with this version LimitRequestBody
is 0 by default (I also explicitly set it to 0 just in case) and setting LimitRequestFields
to 0 didn't solve it either. Then I thought it could be nextcloud and tried filerun out: same result. Finally, I was worried something was wrong with the machine itself because I could not do simple ssh login whenever it hangs. Hell, I could not even ping it using my VPS which acts as its VPN server. But I just found out that if I physically log into the computer and restart its wireguard interface, everything goes back to normal.
Moreover, when i'm connected to the same network as the nextcloud server, even when I access it through the vpn instead using the local IP of the machine, everything works fine and I've been able to upload a 4GB file. However, I think maybe because I'm in the same network my pc is smart enough to stop using the vpn once it knows it can go to the server directly (because we were in the same LAN), and it may just worked because it skipped most of the vpn part.
So, I have no idea why the combination of reverse proxy and wireguard may be faulty and I would really appreciate if someone pointed me in the right direction.
Important details:
- Both the VPS and my server running nextcloud are using Ubuntu 20.04 and Wireguard 1.0.20200513.
- Apache version is 2.4.41.
- Nextcloud 's docker version tag is
latest
, updated yesterday. - The
PersistentKeepAlive
option is set to25
. - Apache's error logs will only say that it cannot make a connection to the backend.
- Restarting the VPS' wireguard interface won't fix it. I had to restart the client's interface.
- Neither setting
LimitRequestBody
norLimitRequestFields
to0
fixed it.