ONLYOFFICE DocumentServer: Difference between revisions
Adapt alternative Caddy config |
Add jwtSecretFile to the minimal example, as it's mandatory from version 7.2 onwards |
||
Line 9: | Line 9: | ||
enable = true; | enable = true; | ||
hostname = "localhost"; | hostname = "localhost"; | ||
jwtSecretFile = config.age.secrets.onlyoffice-jwt.path; | |||
}; | }; | ||
</nowiki>}} | </nowiki>}} |
Revision as of 21:29, 19 August 2024
Onlyoffice Documentserver is a full-featured backend for editing different office documents like Open Document, Word, Excel, etc. online in your browser. The software is open source and can be easily deployed and integrated into existing server software. Available frontends are Nextcloud or the Onlyoffice CommunityServer. It can be also used in own software, see following examples for PHP, Nodejs, etc.
Installation
A minimal example to get a Onlyoffice Documentserver running on localhost should look like this
/etc/nixos/configuration.nix
services.onlyoffice = {
enable = true;
hostname = "localhost";
jwtSecretFile = config.age.secrets.onlyoffice-jwt.path;
};
Configuration
Change default listening port
In case port 80 is already used by a different application or you're using a different web server than Nginx, which is used by the Onlyoffice module, you can change the listening port with the following option:
/etc/nixos/configuration.nix
services.nginx.virtualHosts."localhost".listen = [ { addr = "127.0.0.1"; port = 8080; } ];
Caddy web server
Instead of using the default Nginx web server, an configuration for Caddy might look like this
/etc/nixos/configuration.nix
services.nginx.enable = lib.mkForce false;
users.users.nginx = {
group = "nginx";
isSystemUser = true;
};
users.groups.nginx = {};
services.caddy = {
virtualHosts = {
"office.example.org".extraConfig = ''
reverse_proxy http://127.0.0.1:8000 {
# Required to circumvent bug of Onlyoffice loading mixed non-https content
header_up X-Forwarded-Proto https
}
'';
};
};
The reverse_proxy configuration directly forwards all requests to the Onlyoffice server, ignoring the default Nginx vhost.