81 lines
2.8 KiB
Django/Jinja
81 lines
2.8 KiB
Django/Jinja
; The home-server project produces a multi-purpose setup using Ansible.
|
|
; Copyright © 2018 Y. Gablin, under the GPL-3.0-or-later license.
|
|
; Full licensing information in the LICENSE file, or gnu.org/licences/gpl-3.0.txt if the file is missing.
|
|
|
|
[uwsgi]
|
|
nextcloud_root = {{nextcloud_root}}
|
|
nextcloud_conf = {{nextcloud_conf}}
|
|
nextcloud_apps = {{nextcloud_data}}/apps
|
|
static_ext = (?:css|js|woff2?|svg|gif|png|html|ttf|ico|jpg|jpeg)
|
|
|
|
; load the required plugins, php is loaded as the default (0) modifier
|
|
plugins = 0:php
|
|
|
|
; enable the PHP opcode cache
|
|
php-sapi-name = apache
|
|
|
|
; reload whenever this config file changes
|
|
; %p is the full path of the current config file
|
|
touch-reload = %p
|
|
|
|
;=> system settings
|
|
procname-master = uwsgi[nextcloud]
|
|
master = true
|
|
socket = /run/shared_sockets/nextcloud
|
|
idle = 1800
|
|
die-on-idle = true
|
|
;disable-logging = true
|
|
logformat=%(status) %(method) [%(var.SCRIPT_FILENAME)] %(uri) = %(var.SCRIPT_NAME) %(var.PATH_INFO)
|
|
pty-log
|
|
processes = 4
|
|
cheaper = 1
|
|
offload-threads = 2
|
|
umask = 007
|
|
buffer-size = 8192
|
|
|
|
;=> local routing / rewriting
|
|
#route-uri = ^ log:BEFORE: [${SCRIPT_FILENAME}] ${REQUEST_URI} = ${SCRIPT_NAME} ${PATH_INFO}
|
|
route-uri = ^/xapps(/(?:[^?](?<!\.php/))*\.%(static_ext))(?:\?|$) static:%(nextcloud_apps)$1
|
|
route-uri = ^(/(?:[^?](?<!\.php/))*\.%(static_ext))(?:\?|$) static:%(nextcloud_root)$1
|
|
; useless-looking, but necessary for side-effects
|
|
route-uri = ^(.*)$ rewrite:$1
|
|
#route-uri = ^ log:AFTER: [${SCRIPT_FILENAME}] ${REQUEST_URI} = ${SCRIPT_NAME} ${PATH_INFO}
|
|
|
|
#collect-header = Location NEW_URL
|
|
#error-route-status = 302 goto:checkredirect
|
|
#error-route-uri = ^ goto:checkOK
|
|
#error-route-label = checkredirect
|
|
#error-route-uri = ^ log:*** checkredirect
|
|
#error-route-if-not = equal:${NEW_URL};https://yalis.fr/mn/index.php/apps/files/ goto:checkOK
|
|
#error-route-uri = ^ log:*** Location == apps/files/
|
|
#error-route-uri = ^(?!/index.php/) goto:checkOK
|
|
#error-route-uri = ^ log:*** URI ^ /index.php/
|
|
#error-route-uri = ^ log:REWRITE 302 (${PATH_INFO} -> ${NEW_URL}) AS 404
|
|
#error-route-uri = ^ return:404
|
|
#error-route-label = checkOK
|
|
#error-route-uri = ^ log:*** CANCEL CHECK (${NEW_URL})
|
|
|
|
;=> application settings
|
|
env = NEXTCLOUD_CONFIG_DIR=%(nextcloud_conf)
|
|
|
|
static-expires = ^ 15768000
|
|
|
|
php-docroot = %(nextcloud_root)
|
|
php-index = index.php
|
|
|
|
php-set = expose_php=false
|
|
php-set = zend_extension=opcache.so
|
|
php-set = extension=apcu.so
|
|
; https://github.com/krakjoe/apcu/blob/master/INSTALL
|
|
php-set = apc.ttl=7200
|
|
php-set = apc.enable_cli=1
|
|
php-set = apc.ttl=3600
|
|
; from Nextcloud recommendations
|
|
php-set = opcache.enable=1
|
|
php-set = opcache.enable_cli=1
|
|
php-set = opcache.interned_strings_buffer=8
|
|
php-set = opcache.max_accelerated_files=10000
|
|
php-set = opcache.memory_consumption=128
|
|
php-set = opcache.save_comments=1
|
|
php-set = opcache.revalidate_freq=1
|