How to run Seafile behind nginx reverse proxy?

606 views
Skip to first unread message

Alexey Didenko

unread,
Dec 17, 2014, 3:17:20 AM12/17/14
to sea...@googlegroups.com
Hello all!

My gateway ip is 10.0.4.150. Nging start on this server.
Seafile ip is 10.0.4.151 and running in fastcgi mode.

I need access to the Seafile from the internet.

I reckon, that the configuration will be a look:

server {
        listen 10.0.4.150:80;


        root /var/www;
        index index.html index.htm index.php;
        server_name localhost;

        location /webmail/index.php {
                fastcgi_split_path_info ^(.+\.php)(/.+)$;
                fastcgi_pass unix:/var/run/php5-fpm.sock;
                fastcgi_index index.php;
                include fastcgi_params;
        }

location /seafile {
        fastcgi_pass    10.0.4.151:8000;
        fastcgi_param   SCRIPT_FILENAME     $document_root$fastcgi_script_name;
        fastcgi_param   PATH_INFO           $fastcgi_script_name;

        fastcgi_param   SERVER_PROTOCOL     $server_protocol;
        fastcgi_param   QUERY_STRING        $query_string;
        fastcgi_param   REQUEST_METHOD      $request_method;
        fastcgi_param   CONTENT_TYPE        $content_type;
        fastcgi_param   CONTENT_LENGTH      $content_length;
        fastcgi_param   SERVER_ADDR         $server_addr;
        fastcgi_param   SERVER_PORT         $server_port;
        fastcgi_param   SERVER_NAME         $server_name;

        access_log      /var/log/nginx/seahub.access.log;
        error_log       /var/log/nginx/seahub.error.log;
}

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

location /seafmedia {
        rewrite ^/seafmedia(.*)$ /media$1 break;
        root /var/www/seahub;
}

Directory seahub I moved on the gateway in directory /var/www, and set permissions.
When I'm trying to go to address http://10.0.4.150/seafile, nginx is returning error 502.

Where I could be mistaken in a config?

Thanks.

info....@gmail.com

unread,
Jan 9, 2017, 12:10:52 AM1/9/17
to seafile
I'm facing same issue?? how did u solved it .. can you please explain 

Fabian Peter

unread,
Jan 25, 2017, 8:00:48 AM1/25/17
to seafile
Can u post your nginx config, too? :)
Reply all
Reply to author
Forward
0 new messages