Hey
I moved ownCloud to a subdomain, which also means that the root of ownclouds nginx serverblock is now set to /var/www/owncloud/ instead of /var/www/.
My problem is that I am unable to get dietpi-owncloud.conf working properly. Could someone here help me out with this?
This is my dietpi-owncloud.conf:
# Based on: https://github.com/owncloud/docs/blob/deda107004c35ccfc4927e4aab32a337bc2bb380/modules/admin_manual/examples/installation/nginx/subdirectory-configuration.conf
location ^~ /owncloud {
# Omit Nginx version on error response
server_tokens off;
# Add headers to serve security related headers
add_header Strict-Transport-Security "max-age=15768000; includeSubDomains" always;
add_header X-Content-Type-Options nosniff always;
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-XSS-Protection "0" always;
add_header X-Robots-Tag "none" always;
add_header X-Download-Options noopen always;
add_header X-Permitted-Cross-Domain-Policies none always;
add_header Referrer-Policy no-referrer always;
# Set max upload size
client_max_body_size 1048576M;
# Do not set the number of buffers over 63, in our example it is set to 8.
# When exeeding, big file downloads can possibly consume a lot of system memory over time and cause problems especially on low-mem systems.
fastcgi_buffers 8 4K;
# From ownCloud version 10.0.4 on, a header statement will be sent to nginx not to use buffers to avoid problems with problematic fastcgi_buffers values. See note above.
# If these values are properly set and no problems are expected, you can turn on this statement to reenable buffering overriding the sent header.
# In case you use an earlier version of ownCloud or can´t change the buffers, or you can´t remove a existing ignore header statement, you can explicitly set fastcgi_buffering off;
# These statements are used either or but not together.
fastcgi_ignore_headers X-Accel-Buffering;
# Disable gzip to avoid the removal of the ETag header
# Enabling gzip would also make your server vulnerable to BREACH
# if no additional measures are done. See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=773332
gzip off;
error_page 403 /owncloud/core/templates/403.php;
error_page 404 /owncloud/core/templates/404.php;
location /owncloud {
rewrite ^ /owncloud/index.php;
}
location ~ ^/owncloud/(?:build|tests|config|lib|3rdparty|templates|data)/ {
return 404;
}
location ~ ^/owncloud/(?:\.|autotest|occ|issue|indie|db_|console) {
return 404;
}
location ~ ^/owncloud/(?:index|remote|public|cron|core/ajax/update|status|ocs/v[12]|updater/.+|ocs-provider/.+|core/templates/40[34])\.php(?:$|/) {
fastcgi_split_path_info ^(.+\.php)(/.*)$;
set $path_info $fastcgi_path_info;
try_files $fastcgi_script_name =404;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name; # Necessary for owncloud to detect the contextroot https://github.com/owncloud/core/blob/ce40499f02717afa0af25bf2f67629a3159a29d3/lib/private/AppFramework/Http/Request.php#L603
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param HTTPS $https;
fastcgi_param modHeadersAvailable true; # Avoid sending the security headers twice
fastcgi_param front_controller_active true; # Enable pretty URLs without /index.php/
fastcgi_read_timeout 180; # Increase default timeout e.g. for long running carddav/caldav syncs with 1000+ entries
fastcgi_pass php;
fastcgi_intercept_errors on;
fastcgi_request_buffering off;
}
location ~ ^/owncloud/(?:updater|ocs-provider|ocm-provider)(?:$|/) {
try_files $uri $uri/ =404;
index index.php;
}
# Cache control for assets
location ~ /owncloud/.*\.(?:css|js) {
try_files $uri /owncloud/index.php$uri$is_args$args;
expires 6M;
access_log off; # Optional: Don't log access to assets
}
location ~ /owncloud/.*\.(?:svg|gif|png|html|ttf|woff|ico|jpg|jpeg|map|json) {
try_files $uri /owncloud/index.php$uri$is_args$args;
expires 2h;
access_log off; # Optional: Don't log access to assets
}
}