Hi
We are still in the process of converting from Seafile 11 “normal” installation to Seafile 13 Docker installation.
How can I achieve the same with the docker CE 13 version as what I describe below?
In our “normal” CE 11 installation we always had an upload folder.
NGINX simply forwarded the URL cloud.example.com/upload to that folder.
The NGINX code was the below for that.
location /upload {
proxy_pass https://cloud.example.com/u/d/e1e324e51973324e773e43/
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_set_header X-Forwarded-Proto $scheme;
proxy_read_timeout 1200s;
client_max_body_size 0;
proxy_request_buffering off;
access_log /var/log/nginx/seafdav.access.log;
error_log /var/log/nginx/seafdav.error.log;
}
You can achieve the same behavior in Seafile 13 Docker by adding a reverse-proxy rule in your Nginx or Caddy configuration that maps /upload to the desired shared folder URL.
For example, in Nginx:
location /upload {
proxy_pass https://cloud.example.com/u/d/e1e324e51973324e773e43/;
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_set_header X-Forwarded-Proto $scheme;
proxy_read_timeout 1200s;
client_max_body_size 0;
proxy_request_buffering off;
}
This will let cloud.example.com/upload forward to the target upload folder URL, just like in your previous Seafile 11 setup.
If you use Caddy instead of Nginx, the same idea applies: create a route or rewrite rule that proxies /upload to that shared folder link.
For more information: Use other reverse proxy - Seafile Admin Manual
Ok, I found the solution!
In seafile-server.yml look for
labels:
caddy: ${SEAFILE_SERVER_PROTOCOL:-http}://${SEAFILE_SERVER_HOSTNAME:?Variable is not set or empty}
caddy.reverse_proxy: "{{upstreams 80}}"
then add below
caddy.@upload.path: "/upload /upload/"
caddy.redir: "@upload /u/d/e1e324e51973324e773e43/ 302"
Where the “e1e324e51973324e773e43” is the ID from my initial post.
Then restart with docker compose down / up -d
The upload link will now work.