Trying to get Seafile working behind Nginx reverse proxy on separate VPS

I am trying to change up my Seafile (WSGI mode, v7.0.5) install a bit. I had it running on a Debian 9 VPS with Nginx/HTTPS in front of it. Working like a champ. I had some other stuff I wanted to serve on HTTPS and thought, why not setup a separate VPS for Nginx, and then I can reverse proxy to which every service necessary.

I can sign in, access the web interface etc all just fine. When I attempt to sync a library for the first time, it downloads the file list, downloads some % of the files, then stops with client (Mac 7.0.7) saying “Server error”. I have tried this on several machines. Another Mac had version 7.0.5 I believe. IIRC I may have even tried 7.0.4.

On the server itself, the nginx logs show lines similar to this :

*33462 connect() failed (111: Connection refused) while connecting to upstream, client: 1.1.1.1, server: sync.domain.com, request: “GET /seafhttp/repo/6bc2b052-6efc-4376-b20a-33d7b3a21f97/block/1187296b796583943578bab007f97dc6bdd594ff HTTP/1.1”, upstream: “http://seafile-ip:8081/repo/6bc2b052-6efc-4376-b20a-33d7b3a21f97/block/1187296b796583943578bab007f97dc6bdd594ff”, host: “sync.domain.com

Ive been playing around with nginx and seafile configs, and I really am not sure what the problem is. It ought to work… Help anyone?

I have included a patebin of the relavent config files. I have changed out domains and ip addresses as well :

https://pastebin.com/JbvM9fPe

Thanks for anyone who cares to take a stab at this.

Update: I just don’t get why I can sit there and download upwards of 60% of a given library, literally 50GB or more, then it randomly errors. Here’s the latest error.

On seafile client: **********
[05/16/20 12:55:40] http-tx-mgr.c(4322): Bad response code for GET https://sync.domain.com/seafhttp/repo/6bc2b052-6efc-4376-b20a-33d7b3a21f97/block/51a58e05ead770444810f8ccd268a591a7dbff67: 502.
[05/16/20 12:55:40] repo-mgr.c(4380): Transfer failed.
[05/16/20 12:55:40] http-tx-mgr.c(1157): Transfer repo ‘6bc2b052’: (‘normal’, ‘data’) --> (‘error’, ‘finished’)
[05/16/20 12:55:40] clone-mgr.c(697): Transition clone state for 6bc2b052 from [fetch] to [error]: Server error.

On error log in nginx: **********
[05/16/20 12:55:40] http-tx-mgr.c(4322): Bad response code for GET https://sync.domain.com/seafhttp/repo/6bc2b052-6efc-4376-b20a-33d7b3a21f97/block/51a58e05ead770444810f8ccd268a591a7dbff67: 502.
[05/16/20 12:55:40] repo-mgr.c(4380): Transfer failed.
[05/16/20 12:55:40] http-tx-mgr.c(1157): Transfer repo ‘6bc2b052’: (‘normal’, ‘data’) --> (‘error’, ‘finished’)
[05/16/20 12:55:40] clone-mgr.c(697): Transition clone state for 6bc2b052 from [fetch] to [error]: Server error.

Some more in nginx (another time): **************
2020/05/16 16:59:10 [error] 66850#66850: *31819 connect() failed (111: Connection refused) while connecting to upstream, client: x.x.x.x, server: sync.domain.com, request: “GET /seafhttp/repo/6bc2b052-6efc-4376-b20a-33d7b3a21f97/block/e3b63c6a532c66266e9befe451ee7cc1af1904ef HTTP/1.1”, upstream: “http://seafile-ip:8081/repo/6bc2b052-6efc-4376-b20a-33d7b3a21f97/block/e3b63c6a532c66266e9befe451ee7cc1af1904ef”, host: “sync.domain.com
2020/05/16 17:13:36 [error] 73975#73975: *11791 connect() failed (111: Connection refused) while connecting to upstream, client: x.x.x.x, server: sync.domain.com, request: “GET /seafhttp/repo/6bc2b052-6efc-4376-b20a-33d7b3a21f97/block/6982113a660d6165afa8c70665475683a45831cb HTTP/1.1”, upstream: “http://seafile-ip:8081/repo/6bc2b052-6efc-4376-b20a-33d7b3a21f97/block/6982113a660d6165afa8c70665475683a45831cb”, host: “sync.domain.com
2020/05/16 17:55:40 [error] 74202#74202: *16764 connect() failed (111: Connection refused) while connecting to upstream, client: x.x.x.x, server: sync.domain.com, request: “GET /seafhttp/repo/6bc2b052-6efc-4376-b20a-33d7b3a21f97/block/51a58e05ead770444810f8ccd268a591a7dbff67 HTTP/1.1”, upstream: “http://seafile-ip:8081/repo/6bc2b052-6efc-4376-b20a-33d7b3a21f97/block/51a58e05ead770444810f8ccd268a591a7dbff67”, host: “sync.domain.com
2020/05/16 20:50:21 [error] 74201#74201: *23400 connect() failed (111: Connection refused) while connecting to upstream, client: x.x.x.x, server: sync.domain.com, request: “GET /seafhttp/repo/ec76e6cc-51d2-4083-b68b-994b87ad9263/block/3269fcd34922188ca9a39369884d21648f7563ff HTTP/1.1”, upstream: “http://seafile-ip:8081/repo/ec76e6cc-51d2-4083-b68b-994b87ad9263/block/3269fcd34922188ca9a39369884d21648f7563ff”, host: “sync.domain.com

On seafile error log: **********
Not seeing any entries in here. Nothing from today at least.