Seafile + nginx : OK when listening on port 80, bad 302 redirect otherwise

Hi everyone,
I just made a fresh install of Seafile 6.2.2 for Raspberry Pi.
I want Seafile to be accessible on port 8080 using nginx.

Here is my ccnet.conf :
[General]
USER_NAME = …
ID = …
NAME = …
SERVICE_URL = http://my.domain.net:8080

[Client]
PORT = 13419

Here is seahub_settings.py :
# -- coding: utf-8 --
SECRET_KEY = “…”
HTTP_SERVER_ROOT = ‘http://my.domain.net:8080/seafhttp

And finally the nginx config file :
server {
listen 8080;
server_name my.domain.net;

    proxy_set_header X-Forwarded-For $remote_addr;

    location / {
         proxy_pass         http://127.0.0.1:8000;
         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_read_timeout  1200s;

         # used for view/edit office file via Office Online Server
         client_max_body_size 0;

         access_log      /dev/null;
         error_log       /var/log/nginx/seahub.error.log;
    }

    location /seafhttp {
        rewrite ^/seafhttp(.*)$ $1 break;
        proxy_pass http://127.0.0.1:8082;
        client_max_body_size 0;

        proxy_connect_timeout  36000s;
        proxy_read_timeout  36000s;
        proxy_send_timeout  36000s;

        send_timeout  36000s;
    }

    location /media {
        root /home/seafile/seafile-server-latest/seahub;
    }
}

The issue is that when I go to http://my.domain.net:8080, there is a 302 redirect to http://my.domain.net/accounts/login?next=/ (without the :8080). And of course the login page can’t be reach.

If I configure nginx to listen on port 80, it works because there’s no need for the port anymore.

I can’t find where to configure this 302 redirect to specify the port.

Any help will be appreciated…

Thanks

Hi,

see if this works out for you --> click

1 Like

Hi thanatos,

I saw this topic and I tried that before posting. At least, I thought… I tried a second time and now it works. Maybe I just made a small mistake.

Thank you a lot