====== Preparation of an nginx Web Server ======
The web server software ''nginx'' is very efficient and can handle large numbers of participants well.
PHP is connected by means of ''php-fpm''.
===== Directory Protection =====
Unlike Apache, ''nginx'' does not process ''.htaccess'' files directly in the respective directory.
Instead, access to the directories ''system'' and others must be restricted by appropriate directives in the configuration. Within the ''server'' block these are, e.g.
# Forbidden directories
location ~ ^/(inc|lib|system)/ {
deny all;
return 403;
}
location ~ ^/files/(protected|upload|share)/ {
deny all;
return 403;
}
location ~ ^/download/(release|system|working)/ {
deny all;
return 403;
}
location ~ /\.ht {
deny all;
return 403;
}
# Use default favicon, so no entries will appear in the errorlog
location ~ ^/.*/favicon\.ico$ {
try_files /favicon.ico =404;
}
===== Configuring the API =====
So that the REST API cannot only be called via ''admin/api.php?v1'', but also allows an RFC-compliant URL ''admin/api/v1'', the following "redirect" to the ''api.php'' is required within the ''server'' block.
# Front Controller Setup for API
location ~ ^/admin/api/ {
try_files "" /admin/api.php$is_args$args;
}