Seafile 13: Web UI "400 Bad Request" on Downloads (Android/Windows clients work)

Hi everyone,

I’m a new Seafile user. I recently decided to move away from SMB to manage and share my documents over the internet, and I chose Seafile for its performance.

I am running Seafile via Docker Compose (using Dockge). I recently updated from version 11 to version 13. While everything seems to work perfectly on the Windows and Android clients, I am having a specific issue with the Web Browser (Web UI):

  • What works: Uploading files, deleting files, and editing files (Markdown/Text).

  • The issue: I cannot download any files from the browser. Whenever I click download, I get an HTML error page: “400 Bad Request”.

Since the desktop client works, I suspect it might be a configuration mismatch in the Seafile settings or my Reverse Proxy setup.

Here is my Docker Compose file:
version: “3.8”
services:
db:
image: mariadb:10.11
container_name: seafile-db
environment:

  • MYSQL_ROOT_PASSWORD=your_secure_db_root_password
  • MYSQL_LOG_CONSOLE=true
    volumes:
  • ./seafile-db:/var/lib/mysql
    restart: unless-stopped

redis:
image: redis:alpine
container_name: seafile-redis
restart: unless-stopped

seafile:
image: seafileltd/seafile-mc:13.0-latest
container_name: seafile
ports:

  • 8200:80
    volumes:
  • ./seafile-conf:/shared
  • /mnt/Media/Seafile:/shared/seafile
  • type: bind
    source: /mnt/SSD/dockge-system/stack/seafile/seafile-fuse
    target: /seafile-fuse
    bind:
    propagation: rshared
    privileged: true
    cap_add:
  • SYS_ADMIN
    environment:
  • TIME_ZONE=Europe/Rome
  • JWT_PRIVATE_KEY=your_generated_jwt_private_key
  • SEAFILE_SERVER_PROTOCOL=https
  • SEAFILE_SERVER_HOSTNAME=seafile.yourdomain.top
  • SEAFILE_MYSQL_DB_HOST=db
  • SEAFILE_MYSQL_DB_PORT=3306
  • SEAFILE_MYSQL_DB_USER=seafile
  • SEAFILE_MYSQL_DB_PASSWORD=your_seafile_db_password
  • SEAFILE_MYSQL_DB_CCNET_DB_NAME=ccnet_db
  • SEAFILE_MYSQL_DB_SEAFILE_DB_NAME=seafile_db
  • SEAFILE_MYSQL_DB_SEAHUB_DB_NAME=seahub_db
  • DB_ROOT_PASSWD=your_secure_db_root_password
  • SEAFILE_ADMIN_EMAIL=admin@yourdomain.top
  • SEAFILE_ADMIN_PASSWORD=your_admin_password
  • SEAFILE_SERVER_LETSENCRYPT=false
  • CACHE_PROVIDER=redis
  • REDIS_HOST=redis
  • REDIS_PORT=6379
  • REDIS_PASSWORD=
    depends_on:
  • db
  • redis
    restart: unless-stopped

Does anyone have a suggestion on why the Web UI specifically is failing the download request while clients work fine? Any help would be greatly appreciated!

Here are some suggestions that may help debug the issue:

The “400 Bad Request” error on Seafile Web UI downloads after upgrading to version 13 likely stems from configuration mismatches. Based on the provided documentation, here are the key areas to review:

  1. Obsolete Configurations: Seafile 13 introduced several configuration changes. You should review and remove obsolete configurations, especially SERVICE_URL and FILE_SERVER_ROOT from seahub_settings.py, as these are now managed by environment variables in the Docker setup

  2. Docker Nginx Changes: In Seafile 13.0, the Nginx bundled within the Seafile Docker image no longer generates or reads configurations from mapped volumes. Instead, it’s used for serving static files in Seahub and maps different component ports to a single port 80 internally. This change is crucial for understanding how your external reverse proxy should interact with the Seafile container.

  3. Environment Variables: Ensure that SEAFILE_SERVER_PROTOCOL and SEAFILE_SERVER_HOSTNAME are correctly set in your docker-compose.yml file and align with your reverse proxy configuration. These variables are now the primary way to configure the server protocol and hostname.

You can also use browser’s console to check the exact error.

Hello Daniel,

Thank you for your time and help.

I removed the two lines from seahub_settings.py.

My compose.yml is the one that I posted at the top. The protocol used is HTTPS and the hostname is seafile.mydomain.top (I can confirm this is my Seafile link).

From the browser console, the error is:

Bliss.jpg/?op=download:1 Failed to load resource: the server responded with a status of 400 ()

for the port 80 i didn’t understand well sorry i’m a bit confuse, i access my seafile server from another port IPHost:8200. in my compose.yml seafile container is mapped on port 8200:80 is that what right?
seafile:
image: seafileltd/seafile-mc:13.0-latest
container_name: seafile
ports:

  • 8200:80

I discovered that I can download folders as zip files, but I cannot download individual files like .txt, .png, etc. I can only download folders.

EDIT: found the solution
in seahub_settings.py added the 127.0.0.1 in AllowedHost
ALLOWED_HOSTS = [‘seafile.mydomain.top’,‘192.168.1.100’,‘127.0.0.1’]