diff --git a/nextcloud/Dockerfile.arm64v8 b/nextcloud/Dockerfile.arm64v8 index 61915c7..91ceb82 100644 --- a/nextcloud/Dockerfile.arm64v8 +++ b/nextcloud/Dockerfile.arm64v8 @@ -1,3 +1,6 @@ FROM linuxserver/nextcloud:BASE_TAG +ADD https://github.com/nextcloud/notify_push/releases/download/v0.1.5/notify_push-aarch64 /usr/local/bin/notify_push +RUN chmod +x /usr/local/bin/notify_push + COPY root/ / diff --git a/nextcloud/root/defaults/default b/nextcloud/root/defaults/default index 5c45b40..c1b37bd 100644 --- a/nextcloud/root/defaults/default +++ b/nextcloud/root/defaults/default @@ -20,12 +20,19 @@ server { log_not_found off; access_log off; } - rewrite ^/.well-known/webfinger /public.php?service=webfinger last; - location = /.well-known/carddav { - return 301 $scheme://$host/remote.php/dav; - } - location = /.well-known/caldav { - return 301 $scheme://$host/remote.php/dav; + # Make a regex exception for `/.well-known` so that clients can still + # access it despite the existence of the regex rule + # `location ~ /(\.|autotest|...)` which would otherwise handle requests + # for `/.well-known`. + location ^~ /.well-known { + # The following 6 rules are borrowed from `.htaccess` + + location = /.well-known/carddav { return 301 /remote.php/dav/; } + location = /.well-known/caldav { return 301 /remote.php/dav/; } + # Anything else is dynamically handled by Nextcloud + location ^~ /.well-known { return 301 /index.php$uri; } + + try_files $uri $uri/ =404; } client_max_body_size 10G; fastcgi_buffers 64 4K; @@ -38,6 +45,14 @@ server { location / { rewrite ^ /index.php; } + location /push/ { + proxy_pass http://127.0.0.1:7867/; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + proxy_set_header Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + } location ~ ^\/(?:build|tests|config|lib|3rdparty|templates|data)\/ { deny all; } diff --git a/nextcloud/root/etc/services.d/notify_push/run b/nextcloud/root/etc/services.d/notify_push/run new file mode 100755 index 0000000..bc02793 --- /dev/null +++ b/nextcloud/root/etc/services.d/notify_push/run @@ -0,0 +1,4 @@ +#!/usr/bin/with-contenv bash + +export NEXTCLOUD_URL=http://localhost:80 +exec /usr/local/bin/notify_push /config/www/nextcloud/config/config.php