NextCloud using NGINX and UNIT
Valentin V. Bartenev
vbart at nginx.com
Thu Apr 18 15:23:53 UTC 2019
On Thursday 18 April 2019 14:44:32 Peter TKATCHENKO wrote:
> Hi,
>
> I'm trying to install NextCloud 15 using NGINX and UNIT.
>
> I have a working instance of NextCloud 13 on NGINX and PHP-FPM, so the
> idea is to use the NGINX configuration from the working instance and
> slightly modify it to use UNIT and not PHP-FPM.
>
> I have already installed WordPress with the same configuration (with
> UNIT), using the document from https://unit.nginx.org/howto/wordpress/
>
> The problem is that there is no the ONE file (like in WordPress) that
> should process the requests not ending with *.php, there are SEVERAL
> files like this.
>
> So in PHP-FPM config we use the following NGINX configuration to
> correctly route the traffic to PHP-FPM service:
>
> location ~
> ^/nextcloud/(?:index|remote|public|cron|core/ajax/update|status|ocs/v[12]|updater/.+|ocs-provider/.+)\.php(?:$|/)
> {
> *fastcgi_split_path_info ^(.+\.php)(/.*)$;*
> include fastcgi_params;
> *fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;*
> fastcgi_param PATH_INFO $fastcgi_path_info;
> fastcgi_param HTTPS on;
> fastcgi_param modHeadersAvailable true;
> fastcgi_param front_controller_active true;
> fastcgi_pass php-handler;
> fastcgi_intercept_errors on;
> fastcgi_request_buffering off;
> fastcgi_send_timeout 120s;
> fastcgi_read_timeout 120s;
> }
>
> So, for example, the file /nextcloud/remote.php is used to process the
> requests like /nextcloud/remote.php/webdav/ and the requests like
> /nextcloud/ocs/v2.php/core/navigation/apps?absolute=true&format=json -
> are processed by /nextcloud/ocs/v2.php. The requests without script name
> (like /nextcloud/css/core/afde0962-server.css?v=152fab14-6) are still
> processed by /nextcloud/index.php
>
[..]
Hi,
I suggest the following configuration:
{
"listeners": {
"127.0.0.1:8888": {
"pass": "applications/nextcloud"
}
},
"applications": {
"nextcloud": {
"type": "php",
"script": "nextcloud.php",
"root": "/path/to/root"
}
}
}
with the "nextcloud.php" script (in the attachement).
You should put it into the document root directory (above the "nextcloud" one).
It will do all the magic required by Nextcloud (although not tested).
Note that it requires PHP version 7 or above.
wbr, Valentin V. Bartenev
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nextcloud.php
Type: application/x-php
Size: 458 bytes
Desc: not available
URL: <http://mailman.nginx.org/pipermail/unit/attachments/20190418/109ed124/attachment.bin>
More information about the unit
mailing list