Translations of this page:
 

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;
    }
en/server/prepare2nginx.txt · Last modified: by 127.0.0.1
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
Driven by DokuWiki