Seafile CE12 in docker behind nginx

Hello,
I am trying to run seafile CE 12 on a server that hosts several domains throught nginx.
I have setup a domain name and certificates for seafile and I configured nginx to “proxypass” traffic to port 3163 on my machine through the directive proxy_pass http://127.0.0.1:3163
In .env, I have set SEAFILE_SERVER_HOSTNAME = 127.0.0.1 and “SEAFILE_SERVER_PROTOCOL=http”
In caddy.yml, I have set

ports : 
- 3163:80

Everything else is default (ports for seafile-server.yml and seadoc.yml)
with docker compose up -d, everything starts without error, but I only get a blank, empty page when I try to connect with my browser.
any idea ?

Hello & good day!

Although I am not using nginx, I am using another type of reverse proxy (Apache Traffic Server). With the Docker install of Seafile, I could get both my ATS and Caddy to co-exist but it took a little work.

Essentially though, the way I have it set up is that ATS handles the certs, terminates HTTPS there then passes over to port 80:80 where my Seafile server is deployed.

You mentioned that your nginx server hosts several domains. Then you also mention your own machine as if they were two distinct hosts. If you’ve set nginx on the server to go to 127.0.0.1, it is going to look on the server for Seafile:3163, not your local box. In other words, 127.0.0.1 is essentially “myself”, so if Seafile isn’t hosted where nginx is, then you’ll likely have problems.

If it is just a blank screen in your browser, you may want to open up your browser’s Developer Mode as well and then try to access via browser. When you do, what HTTP response code do you get? Any errors in the network console?

Even if nginx & Seafile are both hosted on your local box, let’s check and see what HTTP responses you get in your browser via Dev Mode.

Hi
Thanks for your prompt answer. Seafile is indeed located on the same machine as the nginx server. I followed your suggestion and used the developer mode in firefox, and the return code is 200, which, if I’m correct, means that everything is OK. But not content in the page.

I think I had similar issues, I am thinking perhaps trying the following?

.env:

  • I do not have an entry for SEAFILE_SERVER_PROTOCOL.
  • SEAFILE_SERVER_HOSTNAME is my external FQDN (if you have one).

caddy.yml:
Only specifies port 80.

seafile-server.yml:

  • Under the labels section, for the caddy key, my SEAFILE_SERVER_PROTOCOL defaults to http.

Just curious to see what happens if you - at least - replace 3163 with 80 (so use 80:80 for Caddy). I wish I had a ready answer as to why I was able to solve a similar issue, I would need to delve more into the Seafile repo. And now I just might :slight_smile:

Hi,
Thanks for your input. I have finaly solved the issue. A very helpful page for that can be found on the seafile website at manual.seafile.com/12.0/setup/use_other_reverse_proxy
It explains how to get rid of caddy, which is not useful anymore if you are behind a pre-existing nginx, and in my case, it seems that my problem is that I had not included the following in my nginx configuration file for the domain (proxy-pass for seadoc, in addition to the one for seafile)

`location /sdoc-server/ {
proxy_pass 127.0.0.1:8888/;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $server_name;

client_max_body_size 100m;

}
`

Hello!

Ah that is good to know!

Yeah, I am at a loss to explain why putting in a proxy_pass directive for Seadoc would fix a blank 200 in the browser, but it sounds like it may be required. This area in the documentation seems to suggest that only the .env & seafile-server.yml files require customization for a base install, but then the wget commands immediately below them include seadoc.yml.

With that said though, the example nginx configuration file here uses the same port for Socket.io communication so maybe that was related to your issue? I’m just speculating though.

Either way, glad you got it working!