diff --git a/admin_manual/configuration_files/serving_static_files_configuration.rst b/admin_manual/configuration_files/serving_static_files_configuration.rst index aa7f2dc9a..52d40d358 100644 --- a/admin_manual/configuration_files/serving_static_files_configuration.rst +++ b/admin_manual/configuration_files/serving_static_files_configuration.rst @@ -86,9 +86,9 @@ Installation ~~~~~~~~~~~~ X-Accel-Redirect is supported by default in Nginx and no additional operation should be needed to install it. -Configuration -~~~~~~~~~~~~~ -Configuration is similar to Apache:: +Configuration - Method 1 +~~~~~~~~~~~~~~~~~~~~~~~~ +Method 1 is prefered because it limits files what files can be served through X-Accel.: location ~ \.php(?:$|/) { ... @@ -130,6 +130,26 @@ Configuration is similar to Apache:: * **~ ^/data/[^/]+/files/LOCAL-MOUNT-NAME/(.+)$** ~ a local external storage mount available to all users +Configuration - Method 2 +~~~~~~~~~~~~~~~~~~~~~~~~ +Method 2 is simplier to setup when using local external storage mounts, especially when they are available to many but not all users. +This method may be prefered if you are regularly adding users that should not all have access to the same local external storage mount(s).: + + location ~ \.php(?:$|/) { + ... + fastcgi_param MOD_X_ACCEL_REDIRECT_ENABLED on; + fastcgi_param MOD_X_ACCEL_REDIRECT_PREFIX /xaccel; + } + + location ^~ /xaccel { + internal; + alias /; + } + +* **fastcgi_param MOD_X_ACCEL_REDIRECT_ENABLED** ~ Tells ownCloud scripts that they should add the X-Accel-Redirect header when serving files. +* **fastcgi_param MOD_X_ACCEL_REDIRECT_PREFIX** ~ A prefix to internally serve files from, in this example "/xaccel" is used but this can be changed. +* **location ^~ /xaccel** ~ The location to internally serve files from, must match MOD_X_ACCEL_REDIRECT_PREFIX. + How to check if it's working? ----------------------------- You are still able to download stuff via the web interface and single, local file downloads can be paused and resumed.