I run Traefik on my host and set it to proxy all of the traffic to the container’s nginx process on port 8001:
On the host:
traefik@myserver:~/traefik-config/conf.d$ cat seafile.yml
http:
services:
seafile:
loadBalancer:
servers:
- url: “http://seafile-server:8001”
routers:
seafile:
tls:
options: modern
rule: Host(`seafile.mydomain.tld`)
middlewares:
- default
service: seafile
entrypoints:
- https
In the Seafile server container:
root@seafile:/shared/nginx/conf# cat seafile.nginx.conf
# -*- mode: nginx -*-
# Auto generated at 09/07/2025 07:07:33
server {
listen 8001;
server_name seafile.mydomain.tld;
client_max_body_size 10m;
location / {
proxy_pass http://127.0.0.1:8000/;
proxy_read_timeout 310s;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $server_name;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Connection "";
proxy_http_version 1.1;
add_header Access-Control-Allow-Origin *;
client_max_body_size 0;
access_log /var/log/nginx/seahub.access.log seafileformat;
error_log /var/log/nginx/seahub.error.log;
}
location /seafhttp {
rewrite ^/seafhttp(.*)$ $1 break;
proxy_pass http://127.0.0.1:8082;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
client_max_body_size 0;
proxy_read_timeout 36000s;
access_log /var/log/nginx/seafhttp.access.log seafileformat;
error_log /var/log/nginx/seafhttp.error.log;
}
location /notification/ping {
proxy_pass http://127.0.0.1:8083/ping;
access_log /var/log/nginx/notification.access.log seafileformat;
error_log /var/log/nginx/notification.error.log;
}
location /notification {
proxy_pass http://127.0.0.1:8083/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
access_log /var/log/nginx/notification.access.log seafileformat;
error_log /var/log/nginx/notification.error.log;
}
location /seafdav {
rewrite ^/seafdav$ /seafdav/ permanent;
}
location /seafdav/ {
proxy_pass http://127.0.0.1:8080/seafdav/;
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;
proxy_read_timeout 1200s;
client_max_body_size 0;
access_log /var/log/nginx/seafdav.access.log seafileformat;
error_log /var/log/nginx/seafdav.error.log;
}
location /:dir_browser {
# Logo of WebDAV
proxy_pass http://127.0.0.1:8080/:dir_browser;
}
location /media {
root /opt/seafile/seafile-server-latest/seahub;
}
}
This worked fine until I updated from 13.0.11 to 13.0.12 today as I started getting 502 Bad Gateway responses. Upon investigation, nginx isn’t bound to port 8001 in the container:
root@seafile:/opt/seafile# netstat -tlnp
Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:8082 0.0.0.0:* LISTEN 80/seaf-server
tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN 146/python3
tcp 0 0 127.0.0.1:8000 0.0.0.0:* LISTEN 151/python3
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 16/nginx: master pr
tcp 0 0 127.0.0.1:8889 0.0.0.0:* LISTEN 123/python3
This seems to be because /etc/nginx/sites-enabled/seafile.nginx.conf doesn’t have a symlink to /shared/nginx/conf/seafile.nginx.conf anymore as can be seen below:
root@seafile:/etc/nginx/sites-enabled# ls -lah
total 12K
drwxr-xr-x 1 root root 4.0K Nov 7 17:12 .
drwxr-xr-x 1 root root 4.0K Nov 7 17:06 ..
-rw-r--r-- 1 root root 1.9K Nov 7 17:12 seafile.nginx.conf
I modified /etc/nginx/sites-enabled/seafile.nginx.conf to listen on port 8001 instead of 80 and that fixed the issue.
So I think that the symlink needs to be recreated in the Docker image.