Commit 3b02e7f8 authored by Daniel's avatar Daniel

Update overlay/root/scripts/nc_config.sh,...

Update overlay/root/scripts/nc_config.sh, overlay/usr/local/etc/nginx/nginx-nextcloud-ssl.conf files
parent 93bf0ffc
......@@ -96,3 +96,7 @@ echo; echo "nextcloud: setup ldap"
# nextcloud-ui not working with nginx setup for nextcloud 20 -> use 19 config
# add ca of ldap to /etc/ssl/cert.pem
# activate app in nextcloud
#to export the certificate from the Domain Controller, and put it on your server under /etc/ssl/#certs (could be different depending on your operating system, i assume ubuntu here).
#Then you reference the cert file under /etc/ldap/ldap.conf
......@@ -95,6 +95,11 @@ server {
# Default Cache-Control policy
expires 1m;
# https://docs.nextcloud.com/server/18/developer_manual/app/requests/index.html#front-controller
location / {
rewrite ^ /index.php;
}
# Rule borrowed from `.htaccess` to handle Microsoft DAV clients
location = / {
if ( $http_user_agent ~ ^DavClnt ) {
......@@ -134,7 +139,7 @@ server {
# which handle static assets (as seen below). If this block is not declared first,
# then Nginx will encounter an infinite rewriting loop when it prepends `/index.php`
# to the URI, resulting in a HTTP 500 error response.
location ~ \.php(?:$|/) {
location ~ ^\/(?:index|remote|public|cron|core\/ajax\/update|status|ocs\/v[12]|updater\/.+|oc[ms]-provider\/.+|.+\/richdocumentscode\/proxy)\.php(?:$|\/) {
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
set $path_info $fastcgi_path_info;
......@@ -151,22 +156,21 @@ server {
fastcgi_intercept_errors on;
fastcgi_request_buffering off;
fastcgi_read_timeout 60s;
}
location ~ \.(?:css|js|svg|gif)$ {
# Adding the cache control header for js, css and map files
# Make sure it is BELOW the PHP block
location ~ \.(?:css|js|woff2?|svg|gif|map)$ {
try_files $uri /index.php$request_uri;
add_header Cache-Control "public, max-age=15778463";
expires 6M; # Cache-Control policy borrowed from `.htaccess`
access_log off; # Optional: Don't log access to assets
}
location ~ \.woff2?$ {
location ~ \.(?:png|html|ttf|ico|jpg|jpeg|bcmap|mp4|webm)$ {
try_files $uri /index.php$request_uri;
expires 7d; # Cache-Control policy borrowed from `.htaccess`
access_log off; # Optional: Don't log access to assets
# Optional: Don't log access to other assets
access_log off;
}
location / {
try_files $uri $uri/ /index.php$request_uri;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment