Forum

Hiawatha + Seafile + OnlyOffice

michael1800
13 November 2018, 02:08
Does anyone currently have Hiawatha working as a reverse proxy for Seafile Community Edition with OnlyOffice (docker) integration? I'm having trouble converting the supplied Apache2/Nginx configs to something that works for Hiawatha.

The OnlyOffice folks suggest the following for Nginx conf:
 
map $http_x_forwarded_proto $the_scheme {
default $http_x_forwarded_proto;
"" $scheme;
}

map $http_x_forwarded_host $the_host {
default $http_x_forwarded_host;
"" $host;
}

map $http_upgrade $proxy_connection {
default upgrade;
"" close;
}


And then the following for the server:
location /onlyofficeds/ {

# THIS ONE IS IMPORTANT ! - Trailing slash !
proxy_pass http://{your Seafile server's domain or IP}:88/;

proxy_http_version 1.1;
client_max_body_size 100M; # Limit Document size to 100MB
proxy_read_timeout 3600s;
proxy_connect_timeout 3600s;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $proxy_connection;

# THIS ONE IS IMPORTANT ! - Subfolder and NO trailing slash !
proxy_set_header X-Forwarded-Host $the_host/onlyofficeds;

proxy_set_header X-Forwarded-Proto $the_scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}


My Hiawatha conf is below. I am still troubleshooting and am starting to dig into the OnlyOffice API to start unraveling things, however, if someone has already invented this particular wheel, I'd welcome the head start. I started with a reverse proxy string in the seahub vhost like
 ^/onlyofficeds/ http://127.0.0.1:88 keep-alive 
. Again, I'm not looking for someone to figure this out for me as much as if someone has already figured it out. The Seafile/Seahub settings are pretty cut-and-dry.

VirtualHost { # Seahub, the web-based interface for Seafile
Hostname = files.mydomain.net
RequiredBinding = secured
RequireTLS = yes
WebsiteRoot = /home/seafile/files.mydomain.net/seafile-server-latest/seahub

ReverseProxy ^/seafhttp/ 1 http://127.0.0.1:8082 600
ReverseProxy .* http://127.0.0.1:8000 25

PreventSQLi = no
}

VirtualHost { # Seafile, the app-based interface for Seafile
Hostname = seafile.files.mydomain.net
RequiredBinding = secured
RequireTLS = yes
WebsiteRoot = /home/seafile/files.mydomain.net/seafile-server-latest/seafile
ReverseProxy .* http://127.0.0.1:8082 3600

PreventSQLi = no
}


This topic has been closed.