Hello community,
I am looking for some support to analyze my issue with the OnlyOffice integration.
I installed seafile manually with nginx. Everything is working fine and for testing purpose I am working with HTTP only.
Now I installed OnlyOffice on the same host but as SNAP package. I am not a big fan of docker so I’d like to give it a try.
After the SNAP installation I had the first issues, seafile was no longer available.
The reason was that the SNAP package uses the same tcp ports as seafile by default does.
So I fixed this and now I can reach seafile and the welcome page of OnlyOffice.
But if I try to open a DOC document I only get a blank page.
I think something is messed up in nginx but I copy & pasted from the manual and changed the needed ports.
Maybe someone of you have tried the same or has a good idea what I am doing wrong.
Greetings,
Tom
Technical information:
IP: 192.168.178.80
Seafile-Nginx listener: 0.0.0.0:80
Seafile-SQL listener: 127.0.0.1:3306
Seafile-Gunicorn listener: 0.0.0.0:8024
OnlyOffice-Nginx(SNAP) listener: 0.0.0.0:8888
ccnet.conf
[General]
USER_NAME = Seafile-Cloud
ID = 1e8011807e528cba2191ea587f4bde0ab50a17c6
NAME = Seafile-Cloud
SERVICE_URL = HTTP 192.168.178.80
[Client]
PORT = 13419
[Database]
ENGINE = mysql
HOST = 127.0.0.1
PORT = 3306
USER = seafile
PASSWD = password
DB = ccnet-db
CONNECTION_CHARSET = utf8
gunicorn.conf
import os
daemon = True
workers = 5
# default localhost:8000
#bind = "127.0.0.1:8000"
bind = "0.0.0.0:8024"
# Pid
pids_dir = '/opt/haiwen/pids'
pidfile = os.path.join(pids_dir, 'seahub.pid')
# for file upload, we need a longer timeout value (default is only 30s, too short)
timeout = 1200
limit_request_line = 8190
seahub_settings.py
# -*- coding: utf-8 -*-
SECRET_KEY = "du)r0g#0yu_x-f2yngv2&)v$j-pptuhcys^0bwnc9oa(-$8x7k"
FILE_SERVER_ROOT = 'HTTP 192.168.178.80/seafhttp'
# Enable Only Office
ENABLE_ONLYOFFICE = True
VERIFY_ONLYOFFICE_CERTIFICATE = False
ONLYOFFICE_APIJS_URL = 'HTTP 127.0.0.1:8888/web-apps/apps/api/documents/api.js'
ONLYOFFICE_FILE_EXTENSION = ('doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx', 'odt', 'fodt', 'odp', 'fodp', 'ods', 'fods')
ONLYOFFICE_EDIT_FILE_EXTENSION = ('docx', 'pptx', 'xlsx')
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'seahub-db',
'USER': 'seafile',
'PASSWORD': 'password',
'HOST': '127.0.0.1',
'PORT': '3306'
}
}
Seafile-Nginx conf
# Required for only office document server
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;
}
log_format seafileformat '$http_x_forwarded_for $remote_addr [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent" $upstream_response_time';
server {
listen 80;
server_name 192.168.178.80;
proxy_set_header X-Forwarded-For $remote_addr;
location / {
proxy_pass HTTP 127.0.0.1:8024;
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 /var/log/nginx/seahub.access.log seafileformat;
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_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_connect_timeout 36000s;
proxy_read_timeout 36000s;
proxy_send_timeout 36000s;
send_timeout 36000s;
access_log /var/log/nginx/seafhttp.access.log seafileformat;
error_log /var/log/nginx/seafhttp.error.log;
}
location /media {
root /opt/haiwen/seafile-server-latest/seahub;
}
location /onlyofficeds/ {
# THIS ONE IS IMPORTANT ! - Trailing slash !
proxy_pass HTTP 127.0.0.1:8888/;
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;
}
}