aboutsummaryrefslogtreecommitdiff
path: root/nixpkgs/nixos/modules/services/web-apps/nextcloud.xml
diff options
context:
space:
mode:
authorKaiden Fey <kookie@spacekookie.de>2020-09-19 15:00:33 +0200
committerKatharina Fey <kookie@spacekookie.de>2020-09-19 15:00:33 +0200
commite0800985dab8f8ebb4cebdfd7e361fd1fafdb2a7 (patch)
tree289f43c72dd1fffeec4eb18ced05ae91e50c179a /nixpkgs/nixos/modules/services/web-apps/nextcloud.xml
parent5581b5521e14317c3507a6e8451a3f14996e5c4d (diff)
parent441a7da8080352881bb52f85e910d8855e83fc55 (diff)
Merge commit '441a7da8080352881bb52f85e910d8855e83fc55'
Diffstat (limited to 'nixpkgs/nixos/modules/services/web-apps/nextcloud.xml')
-rw-r--r--nixpkgs/nixos/modules/services/web-apps/nextcloud.xml61
1 files changed, 57 insertions, 4 deletions
diff --git a/nixpkgs/nixos/modules/services/web-apps/nextcloud.xml b/nixpkgs/nixos/modules/services/web-apps/nextcloud.xml
index 332e4d1ff3e..02e4dba2861 100644
--- a/nixpkgs/nixos/modules/services/web-apps/nextcloud.xml
+++ b/nixpkgs/nixos/modules/services/web-apps/nextcloud.xml
@@ -29,7 +29,6 @@
services.nextcloud = {
<link linkend="opt-services.nextcloud.enable">enable</link> = true;
<link linkend="opt-services.nextcloud.hostName">hostName</link> = "nextcloud.tld";
- <link linkend="opt-services.nextcloud.nginx.enable">nginx.enable</link> = true;
config = {
<link linkend="opt-services.nextcloud.config.dbtype">dbtype</link> = "pgsql";
<link linkend="opt-services.nextcloud.config.dbuser">dbuser</link> = "nextcloud";
@@ -61,9 +60,8 @@
</para>
<para>
- The options <literal>hostName</literal> and <literal>nginx.enable</literal>
- are used internally to configure an HTTP server using
- <literal><link xlink:href="https://php-fpm.org/">PHP-FPM</link></literal>
+ The <literal>hostName</literal> option is used internally to configure an HTTP
+ server using <literal><link xlink:href="https://php-fpm.org/">PHP-FPM</link></literal>
and <literal>nginx</literal>. The <literal>config</literal> attribute set is
used by the imperative installer and all values are written to an additional file
to ensure that changes can be applied by changing the module's options.
@@ -125,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> &amp; <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> = ''
+ &lt;Directory "${config.services.nextcloud.package}"&gt;
+ &lt;FilesMatch "\.php$"&gt;
+ &lt;If "-f %{REQUEST_FILENAME}"&gt;
+ SetHandler "proxy:unix:${config.services.phpfpm.pools.nextcloud.socket}|fcgi://localhost/"
+ &lt;/If&gt;
+ &lt;/FilesMatch&gt;
+ &lt;IfModule mod_rewrite.c&gt;
+ RewriteEngine On
+ RewriteBase /
+ RewriteRule ^index\.php$ - [L]
+ RewriteCond %{REQUEST_FILENAME} !-f
+ RewriteCond %{REQUEST_FILENAME} !-d
+ RewriteRule . /index.php [L]
+ &lt;/IfModule&gt;
+ DirectoryIndex index.php
+ Require all granted
+ Options +FollowSymLinks
+ &lt;/Directory&gt;
+ '';
+ };
+ };
+}</programlisting>
+ </para>
+ </section>
+
<section xml:id="module-services-nextcloud-maintainer-info">
<title>Maintainer information</title>