Skip to content

Collaborate with OnlyOffice for editing and previewing office documents.

Deploy OnlyOffice using Docker

yaml
services:
  office:
    container_name: jmalcloud_office
    image: onlyoffice/documentserver:9.1
    ports:
      - 8080:80
    environment:
      JWT_ENABLED: true
      ALLOW_PRIVATE_IP_ADDRESS: true
      JWT_SECRET: "my_secret"
    restart: always

After deployment, you can use OnlyOffice by completing the configuration in jmalcloud.

  • OnlyOffice Address: The access address for OnlyOffice, for example http://your-domain-or-ip:8080

  • Key: The key configured in JWT_SECRET, for example my_secret in the above configuration

  • Callback Service Address: The API address for jmalcloud, for example http://your-domain-or-ip:8088/api

alt text

Suggestion

When using nginx reverse proxy for jmalcloud, configuring onlyoffice and jmalcloud at different sub-paths under the same domain can speed up document opening speed, for example:

  • jmalcloud: https://cloud.your-domain.com

  • onlyoffice: https://cloud.your-domain.com/office

At this time, the configuration of the OnlyOffice Address should be: https://cloud.your-domain.com/office

The callback service address remains unchanged, and is still the api address of jmalcloud: http://your-domain-or-ip:8088/api.

nginx configuration example:

nginx
location / {
    # jmalcloud Configuration
    proxy_pass http://your-domain-or-ip:8088; 
    proxy_set_header Host $http_host; 
    proxy_set_header X-real-ip $remote_addr; 
    proxy_set_header X-Real-IP $remote_addr; 
    proxy_set_header X-Real-PORT $remote_port; 
    proxy_set_header X-Forwarded-Port $server_port; 
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 
    proxy_set_header REMOTE-HOST $remote_addr; 
    proxy_set_header Upgrade $http_upgrade; 
    proxy_set_header Connection "upgrade"; 
    proxy_set_header X-Forwarded-Proto $scheme; 
    proxy_http_version 1.1; 
    add_header X-Cache $upstream_cache_status; 
    add_header Strict-Transport-Security "max-age=31536000"; 
    proxy_set_header Server-Protocol $server_protocol; 
    proxy_set_header Server-Name $server_name; 
    proxy_set_header Server-Addr $server_addr; 
    proxy_set_header Server-Port $server_port; 
    sendfile on; 
    tcp_nopush on; 
    send_timeout 600s;
    keepalive_timeout 600s;
    output_buffers 1 512k;
}

location /office {
    # onlyoffice Configuration
    proxy_pass  http://your-domain-or-ip:8080;
    proxy_set_header Host $http_host; 
    proxy_set_header X-Real-IP $remote_addr; 
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 
    proxy_set_header REMOTE-HOST $remote_addr; 
    proxy_set_header X-Forwarded-Host $http_host/office;
    proxy_set_header Upgrade $http_upgrade; 
    proxy_set_header Connection $http_connection; 
    proxy_set_header X-Forwarded-Proto $scheme; 
    proxy_set_header X-Forwarded-Port $server_port; 
    proxy_http_version 1.1; 
    add_header X-Cache $upstream_cache_status; 
    add_header Cache-Control no-cache; 
    proxy_ssl_server_name off; 
    proxy_ssl_name $proxy_host; 
}

Published under the MIT License