Let me first cover my current setup for my system:
I’m using Cloudflare for my DNS, and have Nginx Proxy Manager (NPM) running as a reverse proxy. NPM is also what manages my HTTPS cert via Let’s Encrypt. I’m running TrueNAS Scale and have setup Seafile 13 through the apps interface using this config: https://pastebin.com/0bi8D5DF
In order to get this working with HTTPS, I had to modify some configs. First, in my seahub_settings.py, I added these lines to the bottom:
SECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTO", "https")
FILE_SERVER_ROOT = "https://127.0.0.1/seafhttp"
CSRF_TRUSTED_ORIGINS = ["https://127.0.0.1", "http://127.0.0.1"]
Then I created ccnet.conf next to my seahub settings file and put this in there:
[General]
SERVICE_URL = "https://127.0.0.1"
However, I have one significant problem: Seafile appears to be entirely unaware it’s behind a reverse proxy with HTTPS traffic. I can use the Seafile Client just fine on all of my PCs, but if I try to use Collabora/Seadoc, download files from the Seahub interface, or try to download/view any files on my Android phone, I get an error about trying to download a file over an insecure connection despite the site being HTTPS. This is the exact error from Seahub in the JavaScript console:
Mixed Content: The site at 'https://seafile.example.com/' was loaded over a secure connection, but the file at 'https://seafile.example.com/seafhttp/repos/6becddb4-85c8-4741-b8cb-3738547832cf/files//Documents/frames.txt/?op=download' was redirected through an insecure connection. This file should be served over HTTPS. See https://blog.chromium.org/2020/02/protecting-users-from-insecure.html for more details.
This is the initiating link as shown in the network tab:
http://seafile.example.com/seafhttp/repos/6becddb4-85c8-4741-b8cb-3738547832cf/files//Documents/frames.txt/?op=download
If I copy this link, paste it into my address bar, and change it to HTTPS, it downloads just fine. Clearly, everything is working, Seahub is just entirely unaware it’s behind a reverse proxy that’s handling the HTTPS traffic. This makes sense, as the traffic from NPM to Seahub is standard HTTP.
I’ve seen in the Seafile Documentation, https://manual.seafile.com/13.0/setup/use_other_reverse_proxy/#add-reverse-proxy-for-related-services, I need to get rid of Caddy and add a bunch of Nginx configs. I tried doing this through NPM’s custom configuration interface, but that broke Seahub and I couldn’t access it. Bringing back Caddy let me get back in. So that’s where I’m at right now.
Has anyone else gotten Seafile 13 to fully work with NPM? What am I doing wrong?
