Locations /seafhttp /seafdav /media giving errors

So I’ve installed using the recommended yaml (can’t link it).

I found out that there’s already a built in proxy using nginx forwarded to port 80.
That works all fine, the problem is that /seafhttp , /seafdav and /media aren’t working.
So they should be proxied by the built in proxy to port 80.
So if for example gives the dashboard (port 8000), should give the page of port 8082.
Unfortunately this doesn’t work as already mentioned.

/seafhttp gives 500 Internal Server Error
/seafdav gives 502 Bad Gateway
/media gives 403 Forbidden (might be correct)

My docker-compose.yml:

    image: mariadb:10.5
    container_name: seafile-mysql
      - MYSQL_ROOT_PASSWORD=  # Requested, set the root's password of MySQL service.
      - MYSQL_LOG_CONSOLE=true
      - /media/sata/seafile/mysql:/var/lib/mysql  # Requested, specifies the path to MySQL data persistent store.
      - swag

    image: memcached:1.6
    container_name: seafile-memcached
    entrypoint: memcached -m 256
      - swag

    image: seafileltd/seafile-mc:latest
    container_name: seafile
      - "8020:80"
#     - "443:443"  # If https is enabled, cancel the comment.
      - /media/sata/seafile/data:/shared   # Requested, specifies the path to Seafile data persistent store.
      - DB_HOST=seafile-db
      - DB_ROOT_PASSWD=  # Requested, the value shuold be root's password of MySQL service.
      - TIME_ZONE=Etc/UTC  # Optional, default is UTC. Should be uncomment and set to your local time zone.
      - SEAFILE_ADMIN_EMAIL= # Specifies Seafile admin user, default is 'me@example.com'.
      - SEAFILE_ADMIN_PASSWORD=     # Specifies Seafile admin password, default is 'asecret'.
      - SEAFILE_SERVER_LETSENCRYPT=false   # Whether to use https or not.
      - SEAFILE_SERVER_HOSTNAME=seafile.mydomain.com# Specifies your host name if https is enabled.
      - seafile-db
      - memcached
      - swag

This is the auto generated seafile.nginx.conf

# -*- mode: nginx -*-
# Auto generated at 01/24/2023 17:43:23
server {
listen 80;
server_name seafile.mydomain.com;

    client_max_body_size 10m;

    location / {
        proxy_read_timeout 310s;
        proxy_set_header Host $host;
        proxy_set_header Forwarded "for=$remote_addr;proto=$scheme";
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header Connection "";
        proxy_http_version 1.1;

        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_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        client_max_body_size 0;
        proxy_connect_timeout  36000s;
        proxy_read_timeout  36000s;
        proxy_request_buffering off;
        access_log      /var/log/nginx/seafhttp.access.log seafileformat;
        error_log       /var/log/nginx/seafhttp.error.log;

    location /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_set_header   X-Forwarded-Proto $scheme;
        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 /media {
        root /opt/seafile/seafile-server-latest/seahub;

    # For letsencrypt
    location /.well-known/acme-challenge/ {
        alias /var/www/challenges/;
        try_files $uri =404;

I’d like to be able to proxy this to my domain for the upload and download (FILE_SERVER_ROOT). But the locations aren’t working in the first place, which leaves me wondered how I can fix this.

Any help would be appreciated.

Just use port 80 and use all the end points like /seafhttp /seafdav as needed as configured by default.
No need to proxy yourself and tweak configurations.

You can put another proxy like nginx-proxy-manager in front of the proxy, then forward everything to port 80.

Do not overcomplicate.

Ciao, -MN