Merge pull request #95109 from Ma27/nextcloud-reverse-proxy
nixos/nextcloud: add documentation for alternative reverse-proxies
This commit is contained in:
commit
e8bdadb864
2 changed files with 67 additions and 2 deletions
|
@ -47,8 +47,18 @@ let
|
|||
in {
|
||||
|
||||
imports = [
|
||||
( mkRemovedOptionModule [ "services" "nextcloud" "nginx" "enable" ]
|
||||
"The nextcloud module dropped support for other webservers than nginx.")
|
||||
(mkRemovedOptionModule [ "services" "nextcloud" "nginx" "enable" ] ''
|
||||
The nextcloud module supports `nginx` as reverse-proxy by default and doesn't
|
||||
support other reverse-proxies officially.
|
||||
|
||||
However it's possible to use an alternative reverse-proxy by
|
||||
|
||||
* disabling nginx
|
||||
* setting `listen.owner` & `listen.group` in the phpfpm-pool to a different value
|
||||
|
||||
Further details about this can be found in the `Nextcloud`-section of the NixOS-manual
|
||||
(which can be openend e.g. by running `nixos-help`).
|
||||
'')
|
||||
];
|
||||
|
||||
options.services.nextcloud = {
|
||||
|
|
|
@ -123,6 +123,61 @@
|
|||
</para>
|
||||
</section>
|
||||
|
||||
<section xml:id="module-services-nextcloud-httpd">
|
||||
<title>Using an alternative webserver as reverse-proxy (e.g. <literal>httpd</literal>)</title>
|
||||
<para>
|
||||
By default, <package>nginx</package> is used as reverse-proxy for <package>nextcloud</package>.
|
||||
However, it's possible to use e.g. <package>httpd</package> by explicitly disabling
|
||||
<package>nginx</package> using <xref linkend="opt-services.nginx.enable" /> and fixing the
|
||||
settings <literal>listen.owner</literal> & <literal>listen.group</literal> in the
|
||||
<link linkend="opt-services.phpfpm.pools">corresponding <literal>phpfpm</literal> pool</link>.
|
||||
</para>
|
||||
<para>
|
||||
An exemplary configuration may look like this:
|
||||
<programlisting>{ config, lib, pkgs, ... }: {
|
||||
<link linkend="opt-services.nginx.enable">services.nginx.enable</link> = false;
|
||||
services.nextcloud = {
|
||||
<link linkend="opt-services.nextcloud.enable">enable</link> = true;
|
||||
<link linkend="opt-services.nextcloud.hostName">hostName</link> = "localhost";
|
||||
|
||||
/* further, required options */
|
||||
};
|
||||
<link linkend="opt-services.phpfpm.pools._name_.settings">services.phpfpm.pools.nextcloud.settings</link> = {
|
||||
"listen.owner" = config.services.httpd.user;
|
||||
"listen.group" = config.services.httpd.group;
|
||||
};
|
||||
services.httpd = {
|
||||
<link linkend="opt-services.httpd.enable">enable</link> = true;
|
||||
<link linkend="opt-services.httpd.adminAddr">adminAddr</link> = "webmaster@localhost";
|
||||
<link linkend="opt-services.httpd.extraModules">extraModules</link> = [ "proxy_fcgi" ];
|
||||
virtualHosts."localhost" = {
|
||||
<link linkend="opt-services.httpd.virtualHosts._name_.documentRoot">documentRoot</link> = config.services.nextcloud.package;
|
||||
<link linkend="opt-services.httpd.virtualHosts._name_.extraConfig">extraConfig</link> = ''
|
||||
<Directory "${config.services.nextcloud.package}">
|
||||
<FilesMatch "\.php$">
|
||||
<If "-f %{REQUEST_FILENAME}">
|
||||
SetHandler "proxy:unix:${config.services.phpfpm.pools.nextcloud.socket}|fcgi://localhost/"
|
||||
</If>
|
||||
</FilesMatch>
|
||||
<IfModule mod_rewrite.c>
|
||||
RewriteEngine On
|
||||
RewriteBase /
|
||||
RewriteRule ^index\.php$ - [L]
|
||||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
RewriteCond %{REQUEST_FILENAME} !-d
|
||||
RewriteRule . /index.php [L]
|
||||
</IfModule>
|
||||
DirectoryIndex index.php
|
||||
Require all granted
|
||||
Options +FollowSymLinks
|
||||
</Directory>
|
||||
'';
|
||||
};
|
||||
};
|
||||
}</programlisting>
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section xml:id="module-services-nextcloud-maintainer-info">
|
||||
<title>Maintainer information</title>
|
||||
|
||||
|
|
Loading…
Reference in a new issue