`override.config.php`.
One option to work around this is to turn off the cache by setting
the cache size to zero:
```nix
{ services.nextcloud.phpOptions."realpath_cache_size" = "0"; }
```
- **Empty Files on chunked uploads**
Due to a limitation of PHP-FPM, Nextcloud is unable to handle chunked
uploads. See upstream issue
[nextcloud/server#7995](https://github.com/nextcloud/server/issues/7995)
for details.
A workaround is to disable chunked uploads with
{option}`nextcloud.nginx.enableFastcgiRequestBuffering`.
## Using an alternative webserver as reverse-proxy (e.g. `httpd`) {#module-services-nextcloud-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 [](#opt-services.nginx.enable) and fixing the
settings `listen.owner` & `listen.group` in the
[corresponding `phpfpm` pool](#opt-services.phpfpm.pools).
An exemplary configuration may look like this:
```nix
{
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>
'';
};
};
}
```
## Installing Apps and PHP extensions {#installing-apps-php-extensions-nextcloud}
Nextcloud apps are installed statefully through the web interface.
Some apps may require extra PHP extensions to be installed.
This can be configured with the [](#opt-services.nextcloud.phpExtraExtensions) setting.
Alternatively, extra apps can also be declared with the [](#opt-services.nextcloud.extraApps) setting.
When using this setting, apps can no longer be managed statefully because this can lead to Nextcloud updating apps
that are managed by Nix:
```nix
{ config, pkgs, ... }: