Long time user of seafile here with this issue - I’ve never had the avatars/custom images work correctly behind a reverse proxy. Seafile itself however works flawless!
404 error on media:
haproxy as the reverse proxy (but I’ve had this issue ever since using Seafile for the last 6+ years even with Caddy as my RP), I’ve tried everything I can think of but simply cannot get it to work.
Seafile-MC installed w/o the use of Caddy from docker:
compose.yaml:
services:
db:
image: mariadb:10.11
container_name: seafile-pro-mysql
environment:
- MYSQL_ROOT_PASSWORD=*redacted* # Required, set the root's password of MySQL service.
- MYSQL_LOG_CONSOLE=true
- MARIADB_AUTO_UPGRADE=1
volumes:
- /nfs/docker_store/seafile-pro/seafile-mysql/db:/var/lib/mysql # Required, specifies the path to MySQL data persistent store.
networks:
- seafile-pro-net
memcached:
image: memcached:1.6.18
container_name: seafile-pro-memcached
entrypoint: memcached -m 256
networks:
- seafile-pro-net
elasticsearch:
image: elasticsearch:8.13.0
container_name: seafile-elasticsearch
environment:
- discovery.type=single-node
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms2g -Xmx2g"
- "xpack.security.enabled=false"
ulimits:
memlock:
soft: -1
hard: -1
mem_limit: 4g
volumes:
- /nfs/docker_store/seafile-pro/seafile-elasticsearch/data:/usr/share/elasticsearch/data # Required, specifies the path to Elasticsearch data persistent store.
networks:
- seafile-pro-net
seafile:
image: docker.seadrive.org/seafileltd/seafile-pro-mc:11.0-latest
container_name: seafile-pro
ports:
- "8088:80"
# - "443:443" # If https is enabled, cancel the comment.
volumes:
- /nfs/docker_store/seafile-pro/seafile-data:/shared # Required, specifies the path to Seafile data persistent store.
environment:
- DB_HOST=db
- DB_ROOT_PASSWD=*redacted* # Required, the value should be root's password of MySQL service.
- TIME_ZONE=America/Toronto # Optional, default is UTC. Should be uncomment and set to your local time zone.
- SEAFILE_ADMIN_EMAIL=*redacted* # Specifies Seafile admin user, default is 'me@example.com'
- SEAFILE_ADMIN_PASSWORD=*redacted* # Specifies Seafile admin password, default is 'asecret'
- SEAFILE_SERVER_LETSENCRYPT=false # Whether to use https or not
- SEAFILE_SERVER_HOSTNAME=sea.xxx.xxx # Specifies your host name if https is enabled
depends_on:
- db
- memcached
- elasticsearch
networks:
- seafile-pro-net
networks:
seafile-pro-net:
seahub_settings.py:
# -*- coding: utf-8 -*-
SECRET_KEY = "*redacted*"
SERVICE_URL = "https://sea.xxx.xxx"
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'seahub_db',
'USER': 'seafile',
'PASSWORD': '0285fe87-a935-4057-b8c9-3414ce16f3f5',
'HOST': 'db',
'PORT': '3306',
'OPTIONS': {'charset': 'utf8mb4'},
}
}
CACHES = {
'default': {
'BACKEND': 'django_pylibmc.memcached.PyLibMCCache',
'LOCATION': 'memcached:11211',
},
'locmem': {
'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
},
}
COMPRESS_CACHE_BACKEND = 'locmem'
TIME_ZONE = 'America/Toronto'
FILE_SERVER_ROOT = "https://sea.xxx.xxx/seafhttp"
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
CSRF_COOKIE_SECURE = True
SESSION_COOKIE_SECURE = True
ALLOWED_HOSTS = ['.xxx.xxx']
CSRF_TRUSTED_ORIGINS = ['https://sea.xxx.xxx']
haproxy backend passthrough set:

