"Nginx Proxy Manager" causing failure when uploading files

I’ve installed Seafile on my raspberry pi. I have defined an A record on cloudflare (which has strict SSL) to point to my RPi. And I’ve got “Nginx Proxy Manager” docker container on the Pi to serve as reverse proxy.

I can access the GUI via my domain but when I try uploading files the transfer fails at the very end. My hunch is that this happens because I’m missing some settings that Nginx Proxy Manager defaults don’t provide. I don’t have access to the actual nginx config files but Proxy Manager does have an advanced tab where you can enter extra configuration. I was wondering if anyone has managed to successfully configure proxy manager with seafile?

Initially I had the wrong URLs in SERVICE_URL and FILE_SERVER_ROOT and uploads didn’t even begin but now they fail at the end.

Ok I figured it.

You have to define a “custom location” for your entry in Nginx Proxy Manager that points to FILE_SERVER port (default 8082) and has config below:

rewrite ^/seafhttp(.*)$ $1 break;
client_max_body_size 0;
proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_connect_timeout  36000s;
proxy_read_timeout  36000s;
proxy_request_buffering off;

1 Like

Where does Nginx Proxy Manager come from? Is that something you installed? I haven’t seen it before. -Thanks

Nginx Proxy Manager is just a docker image that provides a front-end for configuring reverse proxies: https://github.com/jc21/nginx-proxy-manager

I use it on my Raspberry Pi because I run Home Assistant on it and it’s easy to install Nginx Proxy Manager as a package inside Home Assistant.

Hi Milad,

Thank you for this config, it worked fine for my old Seafile Server installation on WIndows. However I’m moving to Ubuntu server with Docker, at the moment I’m unable to upload files on Seahub, it is stuck in the beginning:
Aantekening 2020-04-30 120207

I’ve configured the SERVICE_URL and FILE_SERVER_ROOT similar like my old installation like this:

My Nginx Proxy manager is running on HomeAssistant as well.

Do you have any pointers for me on troubleshooting this issue?

1 Like

If you’re using docker there’s probably another nginx proxy already running inside the container anyway. So my guess is that you don’t need to define a “custom location” in your nginx proxy manager. However, you probably do have to add that extra port in the “advanced” tab of your proxy manager.

Here’s my nginx config that’s running in a container for an actual nginx conf (and not through the proxy manager gui):

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 $remote_addr;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header Connection "";
    proxy_http_version 1.1;
    proxy_pass http://localhost:4001;
    client_max_body_size 100m;
  }

I think you may need the last two lines in your advanced tab (obviously with the port number you have in your config)

proxy_pass http://localhost:4001;
client_max_body_size 100m;

Got it working after removing the “custom location” in Nginx Proxy Manager. Didn’t need no additional config in the advanced tab. Everything seems to work: uploading from Seahub, Windows client, Android app, …

1 Like

Hi there,

I’ve tried both solutions, the “custom locations” and the “Advanced”, but does not works. It is weird, because I can access files when not in the local network, but I cannot upload or download files. No errors that I can find. This is my config in NPM:

Any thoughts?

Cheers