Looking for help with Nginx Proxy Manager

Hello, I install Seafile 9.0.4 with docker-compose like that:

version: '2.0'
    image: mariadb
    container_name: seafile-mysql
    restart: unless-stopped
      - MYSQL_ROOT_PASSWORD=.......
      - MYSQL_LOG_CONSOLE=true
      - ./data/mariadb:/var/lib/mysql
      - seafile-net

    image: memcached
    container_name: seafile-memcached
    restart: unless-stopped
    entrypoint: memcached -m 256
      - seafile-net
    image: seafileltd/seafile-mc
    container_name: seafile
    restart: unless-stopped
      - "8090:80"
      - ./data/app:/shared
      - DB_HOST=db
      - DB_ROOT_PASSWD=.......
      - TIME_ZONE=Etc/UTC
      - SEAFILE_ADMIN_EMAIL=..........@gmail.com
      - SEAFILE_ADMIN_PASSWORD=..........
      - SEAFILE_SERVER_HOSTNAME=..........ddns.net/seafile
      - db
      - memcached
      - seafile-net


Then I add seafile to my Nginx Proxy Manager as subfolder in custom locations:
http 8090

Next I search in Seafile configuration to add base url /seafile but cannot find that option.
I set in Admin settings>settings
SERVICE_URL: ........net/seafile/
FILE_SERVER_ROOT: .....myserver.......net/seafile/seafhttp
There’s no other option that I can use for base url.

I search in docker-compose folder and find nginx directory: ~/seafile-server/data/app/nginx/conf/seafile.nginx.conf

# -*- mode: nginx -*-
# Auto generated at 03/01/2022 20:44:42
server {
listen 80;
server_name myserver......net/seafile;

    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;

Do I have to modify that file or delete it if I use NPM?

Seafile works on my local adress: but on myserver…net/seafile I see blank page with languages links.


There’s a mess with nginx in their docker container. i’m trying fix almost same issue, but with seafdav.

Thanks for Your answer.
My external site looks that now:

I checked docker-compose logs and I see there’s also some nginx sevice starting, meybe I need to make changes in ~/seafile-server/data/app/nginx/conf/seafile.nginx.conf?
I see there lines:

location / {


location /seafhttp {
        rewrite ^/seafhttp(.*)$ $1 break;


location /seafdav {

I set in docker-compose.yml ports as: 8090:80
Meybe I need to change in that lines?


I wanted to just mention something, when you have an nginx proxy running in docker and it needs to communicate with another container, it’s communicating in parallel. This means your proxy_pass is going to be the internal port - which if you used 8090:80 in docker compose that’s port 80 or just the IP of the seafile docker container such as:

proxy_pass http://ip-of-container/;

Now, of course, the nginx and seafile containers have their own IP addresses outside the local host. Docker containers generally get ips in the 172.17. 0.0/16 address space, but of course these could be manually assigned.

You can dig a little deeper into getting the ips of your containers.

One example - my own setup:
docker-compose.yml of seafile uses ports 8090:80
Ubuntu Server running docker IP:
Inside docker, two containers:

  1. Nginx:
  2. Seafile:

The proxy_pass in my nginx server looks like this:

Hope this helps get you there.

Thanks for answer @kevinc , Can You tell me that proxy_pass I need to set in seafile.nginx.conf? What about that ports:
location / {
location /seafhttp {
rewrite ^/seafhttp(.*)$ $1 break;
location /seafdav {

I have Nginx Proxy Manager set in host mode:
version: ‘3’
image: jlesage/nginx-proxy-manager
restart: unless-stopped
network_mode: host
- “/home/dietpi/.config/nginx-proxy-manager:/config:rw”

I see in Portainer I have IPs for Seafile:

  • Seafile =
  • Seafile-mysql =
  • Seafile-memcached =

Can You help me with that becaouse I really don’t understand docker and nginx?

Alright, I’ll do what I can… but please tell me more about your setup. Can you tell me what base os you’re using? Also, the seafile.nginx.conf - where did you get that conf file? Was it a template? When you terminal into the seafile ( container can you ping the nginx container (whatever that IP is) and vice versa?

Also, just share your docker-compose (maybe on pastebin) for seafile and seafile.nginx.conf files (redact personal or sensitive info) and I’ll take a look.

I post my Seafile docker-compose and seafile.nginx.conf in my first post. That seafile.nginx.conf I find in dietpi@DietPi:~/seafile-server/data/app/nginx/conf/seafile.nginx.conf. I never use any nginx conf file. I use Nginx Proxy Manager and add apps as subfolders. Then just set in apps base url and that just works.
I use DietpiOS (debian 11) on HP intel miniPC, kernel 5.10 x86_64.
I don’t know how to ping that Nginx Proxy Manager because I don’t see any IP with docker ps or in Pointainer

dietpi@DietPi:~/seafile-server/data/app/nginx/conf$ docker ps
CONTAINER ID   IMAGE                                COMMAND                  CREATED        STATUS        PORTS                                                                                  NAMES
93142aabc162   mariadb:latest                       "docker-entrypoint.s…"   2 hours ago    Up 2 hours    3306/tcp                                                                               seafile-mysql
8bf08ecc0ffb   seafileltd/seafile-mc                "/sbin/my_init -- /s…"   16 hours ago   Up 16 hours>80/tcp, :::8090->80/tcp                                                  seafile
1b58e86d9298   memcached                            "memcached -m 256"       16 hours ago   Up 16 hours   11211/tcp                                                                              seafile-memcached
fbb37b6c6c1a   koenkk/zigbee2mqtt:latest            "docker-entrypoint.s…"   2 days ago     Up 2 days>8080/tcp,>8080/tcp, :::8081->8080/tcp, :::9999->8080/tcp   zigbee2mqtt
0022ef2e1e7b   lscr.io/linuxserver/wireguard        "/init"                  3 days ago     Up 2 days>51820/udp, :::51820->51820/udp                                          wireguard
62569b171261   jlesage/nginx-proxy-manager:latest   "/init"                  9 days ago     Up 2 days                                                                                            npm_nginx-proxy-manager_1
145c06ce4b4f   eclipse-mosquitto:2.0                "/docker-entrypoint.…"   3 weeks ago    Up 2 days>1883/tcp, :::1883->1883/tcp,>9001/tcp, :::9001->9001/tcp   dietpi_mqtt_1
d6bb53ee93e7   portainer/portainer-ce               "/portainer -H unix:…"   3 weeks ago    Up 2 days     8000/tcp, 9443/tcp,>9000/tcp, :::9000->9000/tcp                          portainer
2492862a0f7d   hrfee/jfa-go                         "/opt/jfa-go/jfa-go …"   4 weeks ago    Up 2 days>8056/tcp, :::8056->8056/tcp, 8057/tcp                                    jfago
ec78fe2025e1   containrrr/watchtower                "/watchtower"            4 weeks ago    Up 2 days     8080/tcp                                                                               watchtower


Ok, yea… thanks… I should have checked your first post… busy day for me.

But, let’s just do something basic, get into the terminal of your nginx container (use a command like this) - the /bin/sh might need to be /bin/bash:
docker exec -it -u root npm_nginx-proxy-manager_1 /bin/sh

Once in that terminal, do these things to make sure nginx can see seafile:

  1. Ping all the other containers: Seafile =, Seafile-mysql =, Seafile-memcached = - does that succeed?
  2. Determine where web interfaces might be and see if you can get any data, such as the seafile hub:
    curl -Is | head -n 1
    This an example, something is there, there will be no response if nothing:

Doing those things might show some things that might be going on, give them a try and let me know and I’ll look at your files in a bit.

  1. Ping works for that three containers:
dietpi@DietPi:~$ docker exec -it -u root npm_nginx-proxy-manager_1 /bin/sh
/tmp # ping
PING ( 56 data bytes
64 bytes from seq=0 ttl=64 time=0.045 ms
64 bytes from seq=1 ttl=64 time=0.049 ms
64 bytes from seq=2 ttl=64 time=0.050 ms
64 bytes from seq=3 ttl=64 time=0.049 ms
64 bytes from seq=4 ttl=64 time=0.050 ms
64 bytes from seq=5 ttl=64 time=0.050 ms
64 bytes from seq=6 ttl=64 time=0.050 ms
--- ping statistics ---
7 packets transmitted, 7 packets received, 0% packet loss
round-trip min/avg/max = 0.045/0.049/0.050 ms
/tmp # ping
PING ( 56 data bytes
64 bytes from seq=0 ttl=64 time=0.076 ms
64 bytes from seq=1 ttl=64 time=0.049 ms
64 bytes from seq=2 ttl=64 time=0.049 ms
64 bytes from seq=3 ttl=64 time=0.049 ms
--- ping statistics ---
4 packets transmitted, 4 packets received, 0% packet loss
round-trip min/avg/max = 0.049/0.055/0.076 ms
/tmp # ping
PING ( 56 data bytes
64 bytes from seq=0 ttl=64 time=0.090 ms
64 bytes from seq=1 ttl=64 time=0.049 ms
64 bytes from seq=2 ttl=64 time=0.050 ms
--- ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max = 0.049/0.063/0.090 ms
/tmp # 
dietpi@DietPi:~$ curl -Is | head -n 1
HTTP/1.1 302 Found


@kevinc meybe that is permissions problem?

root@DietPi:/home/dietpi/seafile-server/data/app# ls -l
razem 12
drwxr-xr-x 3 root root 4096 03-01 21:44 logs
drwxr-xr-x 3 root root 4096 03-01 21:44 nginx
drwxr-xr-x 7 root root 4096 03-01 21:44 seafile

root@DietPi:/home/dietpi/seafile-server/data/app/seafile# ls -l
razem 20
drwx------ 2 root root 4096 03-01 21:44 ccnet
drwx------ 3 root root 4096 03-03 21:24 conf
drwxr-xr-x 2 root root 4096 03-01 21:44 logs
drwx------ 6 root root 4096 03-01 21:44 seafile-data
drwxr-xr-x 5 root root 4096 03-02 09:16 seahub-data

root@DietPi:/home/dietpi/seafile-server/data/app/seafile/conf# ls -l
razem 24
-rw-r--r-- 1 root root  212 03-02 22:12 ccnet.conf
-rw-r--r-- 1 root root  299 03-01 21:44 gunicorn.conf.py
drwxr-xr-x 2 root root 4096 03-02 22:14 __pycache__
-rw-r--r-- 1 root root   60 03-01 21:44 seafdav.conf
-rw-r--r-- 1 root root  225 03-02 10:18 seafile.conf
-rwx------ 1 root root  897 03-02 22:14 seahub_settings.py
root@DietPi:/home/dietpi/seafile-server/data/app/seafile/conf# cat seafile.conf 
port = 8090
host =  ## default port

type = mysql
host = db
port = 3306
user = seafile
password = .................................................................
db_name = seafile_db
connection_charset = utf8

root@DietPi:/home/dietpi/seafile-server/data/app/seafile/conf# cat seahub_settings.py 
# -*- coding: utf-8 -*-
SECRET_KEY = "..........................................................."
SERVICE_URL = "https://myserver.ddns.net/seafile"

    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME': 'seahub_db',
        'USER': 'seafile',
        'PASSWORD': '...........................................',
        'HOST': 'db',
        'PORT': '3306',
        'OPTIONS': {'charset': 'utf8mb4'},

    'default': {
        'BACKEND': 'django_pylibmc.memcached.PyLibMCCache',
        'LOCATION': 'memcached:11211',
    'locmem': {
        'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
HTTP_SERVER_ROOT = "https://myserver.ddns.net/seafile/seafhttp"
OFFICE_CONVERTOR_ROOT = 'http://office-preview:8089'
#SITE_ROOT = "https://myserver.ddns.net/seafile"
root@DietPi:/home/dietpi/seafile-server/data/app/seafile/conf# cat ccnet.conf 
SERVICE_URL = https://myserver.ddns.net/seafile
ENGINE = mysql
HOST = db
PORT = 3306
USER = seafile
PASSWD = ..............................................
DB = ccnet_db