Linked Devices in Profile show Docker IP addresses

Hi all,

I have had Seafile running in Docker for a while now. I recently changed my NGINX configuration and wanted to confirm that Seafile is still receiving the XForwarded headers. I checked the “Linked Devices” section in my profile. I had never checked this before, but I guess I should have, because all clients / devices basically show up with the same IP address, the one from my Docker Swarm ingress endpoint.

Does Seafile not respect the XForwarded headers when logging those clients or have I configured something wrong?

Component Version
Docker Engine version (using swarm mode) 28.5.1
nginx version nginx/1.29.2
Server Version (pro) 12.0.17

Relevant location block from nginx.conf (the comments show what the proxy-default.conf includes):

    location / {
        set $target "http://drive_app";

        proxy_pass $target;
        include snippets/proxy-default.conf;
#         proxy_set_header Host $host;
#         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 https;
        proxy_read_timeout 1200s;

        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection $connection_upgrade;
    }

Putting the proxy_set_header directives directly into the location block does not change the behavior (that was the change I was talking about, because I wanted to standardize my configuration more).

Any help is highly appreciated.

~ Moritz

Well, now that I’ve put everything together into a post I had another idea. Don’t know why I did not check this beforehand; NGINX also only saw the Docker Swarm ingress endpoint IP.

A stackoverflow answer helped me. You can specify that a port should not be published on ingress but rather on every host. See Docker Compose file reference > services for further reading.

This has now solved my problem and Seafile correctly displays the actual IP addresses.

(I would’ve added links to my two sources, but I am not allowed to :confused:)