diff --git a/nixos/modules/services/web-apps/nextcloud.nix b/nixos/modules/services/web-apps/nextcloud.nix
index d9660852528..c2317880553 100644
--- a/nixos/modules/services/web-apps/nextcloud.nix
+++ b/nixos/modules/services/web-apps/nextcloud.nix
@@ -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 = {
diff --git a/nixos/modules/services/web-apps/nextcloud.xml b/nixos/modules/services/web-apps/nextcloud.xml
index f8b92244c89..02e4dba2861 100644
--- a/nixos/modules/services/web-apps/nextcloud.xml
+++ b/nixos/modules/services/web-apps/nextcloud.xml
@@ -123,6 +123,61 @@
+
+ Using an alternative webserver as reverse-proxy (e.g. httpd)
+
+ By default, nginx is used as reverse-proxy for nextcloud.
+ However, it's possible to use e.g. httpd by explicitly disabling
+ nginx using and fixing the
+ settings listen.owner & listen.group in the
+ corresponding phpfpm pool.
+
+
+ An exemplary configuration may look like this:
+{ config, lib, pkgs, ... }: {
+ services.nginx.enable = false;
+ services.nextcloud = {
+ enable = true;
+ hostName = "localhost";
+
+ /* further, required options */
+ };
+ services.phpfpm.pools.nextcloud.settings = {
+ "listen.owner" = config.services.httpd.user;
+ "listen.group" = config.services.httpd.group;
+ };
+ services.httpd = {
+ enable = true;
+ adminAddr = "webmaster@localhost";
+ extraModules = [ "proxy_fcgi" ];
+ virtualHosts."localhost" = {
+ documentRoot = config.services.nextcloud.package;
+ extraConfig = ''
+ <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>
+ '';
+ };
+ };
+}
+
+
+