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 :
ID = …
NAME = …

PORT = 13419

Here is :
# -- coding: utf-8 --

And finally the nginx config file :
server {
listen 8080;

    proxy_set_header X-Forwarded-For $remote_addr;

    location / {
         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;
        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, there is a 302 redirect to (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…



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