How do I configure my uWSGI correctly?

I had a working Nextcloud installation with a similar setup as I describe below up to a few months ago – except it was on a Raspberry Pi, which is not supported by Manjaro any more, so all package and app versions were horribly outdated. I decided to move hardware. Now I have tried to re-install Nextcloud from scratch, but I run into a 404 with just the body ‘Not Found’ for all pages under https://mydomain/nextcloud/ and I cannot figure out why.

Like last time, I have tried to follow the instructions on Nextcloud - ArchWiki for setting up Nextcloud with Nginx and uWSGI in a subdirectory of the domain root. This time, I can’t get it to work. I have re-checked the installation twice, tried to understand my setup, activated debug logging in my nginx and found plausible-looking paths in there, and now I’m at my wit’s end to figure out what I did wrong this time round.

The Basics

  • Nextcloud Server version: 33.0.5.1
  • Operating system and version: Linux 6.12.94-1-MANJARO x86_64
  • Web server and version: nginx/1.30.2
  • Application server: uwsgi 2.0.31-3
  • PHP version: php-legacy 8.3.32-1
  • Installation method: Manjaro’s pacman and following the instructions in Nextcloud - ArchWiki
  • Are you using CloudfIare, mod_security, or similar? No.

Nextcloud

The Nextcloud log is empty.

Web Server Access Log

2a02:8108:8200:e800::8215 - - [11/Jul/2026:14:25:23 +0200] "GET /nextcloud/ HTTP/2.0" 404 29 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36"
2a02:8108:8200:e800::8215 - - [11/Jul/2026:14:25:37 +0200] "GET /nextcloud/index.php HTTP/2.0" 404 29 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36"

Web Server Error Log

The raw error log contains a lot of debug output, which I activated for the reason of getting ahead with this problem. Because I’m new to nginx and its debugging, I am uncertain what to exclude and provide the entire dump.

error log with debug statements
2026/07/11 14:27:22 [debug] 7388#7388: epoll: fd:14 ev:0005 d:00005575BAC0E7A0
2026/07/11 14:27:22 [debug] 7388#7388: *1842 http keepalive handler
2026/07/11 14:27:22 [debug] 7388#7388: *1842 malloc: 00005575BAAA5E00:1024
2026/07/11 14:27:22 [debug] 7388#7388: *1842 SSL_read: 429
2026/07/11 14:27:22 [debug] 7388#7388: *1842 SSL_read: -1
2026/07/11 14:27:22 [debug] 7388#7388: *1842 SSL_get_error: 2
2026/07/11 14:27:22 [debug] 7388#7388: *1842 reusable connection: 0
2026/07/11 14:27:22 [debug] 7388#7388: *1842 posix_memalign: 00005575BAAA3F90:4096 @16
2026/07/11 14:27:22 [debug] 7388#7388: *1842 event timer del: 14: 235457113
2026/07/11 14:27:22 [debug] 7388#7388: *1842 http process request line
2026/07/11 14:27:22 [debug] 7388#7388: *1842 http request line: "GET /nextcloud/index.php/204 HTTP/1.1"
2026/07/11 14:27:22 [debug] 7388#7388: *1842 http uri: "/nextcloud/index.php/204"
2026/07/11 14:27:22 [debug] 7388#7388: *1842 http args: ""
2026/07/11 14:27:22 [debug] 7388#7388: *1842 http exten: ""
2026/07/11 14:27:22 [debug] 7388#7388: *1842 posix_memalign: 00005575BAC074D0:4096 @16
2026/07/11 14:27:22 [debug] 7388#7388: *1842 http process request header line
2026/07/11 14:27:22 [debug] 7388#7388: *1842 http header: "Host: mydomain"
2026/07/11 14:27:22 [debug] 7388#7388: *1842 http header: "User-Agent: Mozilla/5.0 (Linux) mirall/33.0.5daily (Nextcloud, manjaro-6.12.94-1-MANJARO ClientArchitecture: x86_64 OsArchitecture: x86_64)"
2026/07/11 14:27:22 [debug] 7388#7388: *1842 http header: "Accept: */*"
2026/07/11 14:27:22 [debug] 7388#7388: *1842 http header: "X-Request-Id: 7bbfee8b-ab8e-4475-8206-1b0de7232d23"
2026/07/11 14:27:22 [debug] 7388#7388: *1842 http header: "Cookie: nc_sameSiteCookielax=true; nc_sameSiteCookiestrict=true"
2026/07/11 14:27:22 [debug] 7388#7388: *1842 http header: "Connection: Keep-Alive"
2026/07/11 14:27:22 [debug] 7388#7388: *1842 http header: "Accept-Encoding: zstd, br, gzip, deflate"
2026/07/11 14:27:22 [debug] 7388#7388: *1842 http header: "Accept-Language: en-IE,*"
2026/07/11 14:27:22 [debug] 7388#7388: *1842 http header done
2026/07/11 14:27:22 [debug] 7388#7388: *1842 generic phase: 0
2026/07/11 14:27:22 [debug] 7388#7388: *1842 rewrite phase: 1
2026/07/11 14:27:22 [debug] 7388#7388: *1842 test location: "/nextcloud"
2026/07/11 14:27:22 [debug] 7388#7388: *1842 test location: "/nextcloud"
2026/07/11 14:27:22 [debug] 7388#7388: *1842 test location: "/remote"
2026/07/11 14:27:22 [debug] 7388#7388: *1842 test location: ~ "^/nextcloud/(?:build|tests|config|lib|3rdparty|templates|data)(?:$|/)"
2026/07/11 14:27:22 [debug] 7388#7388: *1842 test location: ~ "^/nextcloud/(?:\.|autotest|occ|issue|indie|db_|console)"
2026/07/11 14:27:22 [debug] 7388#7388: *1842 test location: ~ "^/nextcloud/(?:composer\.(?:json|lock)|package(?:-lock)?\.json|core/shipped\.json)$"
2026/07/11 14:27:22 [debug] 7388#7388: *1842 test location: ~ "\.php(?:$|/)"
2026/07/11 14:27:22 [debug] 7388#7388: *1842 using configuration "\.php(?:$|/)"
2026/07/11 14:27:22 [debug] 7388#7388: *1842 http cl:-1 max:536870912
2026/07/11 14:27:22 [debug] 7388#7388: *1842 rewrite phase: 3
2026/07/11 14:27:22 [debug] 7388#7388: *1842 post rewrite phase: 4
2026/07/11 14:27:22 [debug] 7388#7388: *1842 generic phase: 5
2026/07/11 14:27:22 [debug] 7388#7388: *1842 generic phase: 6
2026/07/11 14:27:22 [debug] 7388#7388: *1842 generic phase: 7
2026/07/11 14:27:22 [debug] 7388#7388: *1842 generic phase: 8
2026/07/11 14:27:22 [debug] 7388#7388: *1842 access phase: 9
2026/07/11 14:27:22 [debug] 7388#7388: *1842 access phase: 10
2026/07/11 14:27:22 [debug] 7388#7388: *1842 access phase: 11
2026/07/11 14:27:22 [debug] 7388#7388: *1842 post access phase: 12
2026/07/11 14:27:22 [debug] 7388#7388: *1842 generic phase: 13
2026/07/11 14:27:22 [debug] 7388#7388: *1842 generic phase: 14
2026/07/11 14:27:22 [debug] 7388#7388: *1842 http init upstream, client timer: 0
2026/07/11 14:27:22 [debug] 7388#7388: *1842 http script copy: "QUERY_STRING"
2026/07/11 14:27:22 [debug] 7388#7388: *1842 uwsgi param: "QUERY_STRING: "
2026/07/11 14:27:22 [debug] 7388#7388: *1842 http script copy: "REQUEST_METHOD"
2026/07/11 14:27:22 [debug] 7388#7388: *1842 http script var: "GET"
2026/07/11 14:27:22 [debug] 7388#7388: *1842 uwsgi param: "REQUEST_METHOD: GET"
2026/07/11 14:27:22 [debug] 7388#7388: *1842 http script copy: "CONTENT_TYPE"
2026/07/11 14:27:22 [debug] 7388#7388: *1842 uwsgi param: "CONTENT_TYPE: "
2026/07/11 14:27:22 [debug] 7388#7388: *1842 http script copy: "CONTENT_LENGTH"
2026/07/11 14:27:22 [debug] 7388#7388: *1842 uwsgi param: "CONTENT_LENGTH: "
2026/07/11 14:27:22 [debug] 7388#7388: *1842 http script copy: "REQUEST_URI"
2026/07/11 14:27:22 [debug] 7388#7388: *1842 http script var: "/nextcloud/index.php/204"
2026/07/11 14:27:22 [debug] 7388#7388: *1842 uwsgi param: "REQUEST_URI: /nextcloud/index.php/204"
2026/07/11 14:27:22 [debug] 7388#7388: *1842 http script copy: "PATH_INFO"
2026/07/11 14:27:22 [debug] 7388#7388: *1842 http script var: "/nextcloud/index.php/204"
2026/07/11 14:27:22 [debug] 7388#7388: *1842 uwsgi param: "PATH_INFO: /nextcloud/index.php/204"
2026/07/11 14:27:22 [debug] 7388#7388: *1842 http script copy: "DOCUMENT_ROOT"
2026/07/11 14:27:22 [debug] 7388#7388: *1842 http script var: "/usr/share/webapps"
2026/07/11 14:27:22 [debug] 7388#7388: *1842 uwsgi param: "DOCUMENT_ROOT: /usr/share/webapps"
2026/07/11 14:27:22 [debug] 7388#7388: *1842 http script copy: "SERVER_PROTOCOL"
2026/07/11 14:27:22 [debug] 7388#7388: *1842 http script var: "HTTP/1.1"
2026/07/11 14:27:22 [debug] 7388#7388: *1842 uwsgi param: "SERVER_PROTOCOL: HTTP/1.1"
2026/07/11 14:27:22 [debug] 7388#7388: *1842 http script copy: "REQUEST_SCHEME"
2026/07/11 14:27:22 [debug] 7388#7388: *1842 http script var: "https"
2026/07/11 14:27:22 [debug] 7388#7388: *1842 uwsgi param: "REQUEST_SCHEME: https"
2026/07/11 14:27:22 [debug] 7388#7388: *1842 http script copy: "HTTPS"
2026/07/11 14:27:22 [debug] 7388#7388: *1842 http script var: "on"
2026/07/11 14:27:22 [debug] 7388#7388: *1842 uwsgi param: "HTTPS: on"
2026/07/11 14:27:22 [debug] 7388#7388: *1842 http script copy: "REMOTE_ADDR"
2026/07/11 14:27:22 [debug] 7388#7388: *1842 http script var: "2a02:8108:8200:e800::8215"
2026/07/11 14:27:22 [debug] 7388#7388: *1842 uwsgi param: "REMOTE_ADDR: 2a02:8108:8200:e800::8215"
2026/07/11 14:27:22 [debug] 7388#7388: *1842 http script copy: "REMOTE_PORT"
2026/07/11 14:27:22 [debug] 7388#7388: *1842 http script var: "44540"
2026/07/11 14:27:22 [debug] 7388#7388: *1842 uwsgi param: "REMOTE_PORT: 44540"
2026/07/11 14:27:22 [debug] 7388#7388: *1842 http script copy: "SERVER_PORT"
2026/07/11 14:27:22 [debug] 7388#7388: *1842 http script var: "443"
2026/07/11 14:27:22 [debug] 7388#7388: *1842 uwsgi param: "SERVER_PORT: 443"
2026/07/11 14:27:22 [debug] 7388#7388: *1842 http script copy: "SERVER_NAME"
2026/07/11 14:27:22 [debug] 7388#7388: *1842 http script var: "mydomain"
2026/07/11 14:27:22 [debug] 7388#7388: *1842 uwsgi param: "SERVER_NAME: mydomain"
2026/07/11 14:27:22 [debug] 7388#7388: *1842 http script copy: "HTTP_HOST"
2026/07/11 14:27:22 [debug] 7388#7388: *1842 http script var: "mydomain"
2026/07/11 14:27:22 [debug] 7388#7388: *1842 http script var: ""
2026/07/11 14:27:22 [debug] 7388#7388: *1842 http script var: ""
2026/07/11 14:27:22 [debug] 7388#7388: *1842 uwsgi param: "HTTP_HOST: mydomain"
2026/07/11 14:27:22 [debug] 7388#7388: *1842 uwsgi param: "HTTP_USER_AGENT: Mozilla/5.0 (Linux) mirall/33.0.5daily (Nextcloud, manjaro-6.12.94-1-MANJARO ClientArchitecture: x86_64 OsArchitecture: x86_64)"
2026/07/11 14:27:22 [debug] 7388#7388: *1842 uwsgi param: "HTTP_ACCEPT: */*"
2026/07/11 14:27:22 [debug] 7388#7388: *1842 uwsgi param: "HTTP_X_REQUEST_ID: 7bbfee8b-ab8e-4475-8206-1b0de7232d23"
2026/07/11 14:27:22 [debug] 7388#7388: *1842 uwsgi param: "HTTP_COOKIE: nc_sameSiteCookielax=true; nc_sameSiteCookiestrict=true"
2026/07/11 14:27:22 [debug] 7388#7388: *1842 uwsgi param: "HTTP_CONNECTION: Keep-Alive"
2026/07/11 14:27:22 [debug] 7388#7388: *1842 uwsgi param: "HTTP_ACCEPT_ENCODING: zstd, br, gzip, deflate"
2026/07/11 14:27:22 [debug] 7388#7388: *1842 uwsgi param: "HTTP_ACCEPT_LANGUAGE: en-IE,*"
2026/07/11 14:27:22 [debug] 7388#7388: *1842 http cleanup add: 00005575BAC082F0
2026/07/11 14:27:22 [debug] 7388#7388: *1842 get rr peer, try: 1
2026/07/11 14:27:22 [debug] 7388#7388: *1842 stream socket 15
2026/07/11 14:27:22 [debug] 7388#7388: *1842 epoll add connection: fd:15 ev:80002005
2026/07/11 14:27:22 [debug] 7388#7388: *1842 connect to unix:/run/uwsgi/nextcloud.sock, fd:15 #1865
2026/07/11 14:27:22 [debug] 7388#7388: *1842 connected
2026/07/11 14:27:22 [debug] 7388#7388: *1842 http upstream connect: 0
2026/07/11 14:27:22 [debug] 7388#7388: *1842 posix_memalign: 00005575BABFE900:128 @16
2026/07/11 14:27:22 [debug] 7388#7388: *1842 http upstream send request
2026/07/11 14:27:22 [debug] 7388#7388: *1842 http upstream send request body
2026/07/11 14:27:22 [debug] 7388#7388: *1842 chain writer buf fl:1 s:785
2026/07/11 14:27:22 [debug] 7388#7388: *1842 chain writer in: 00005575BAC08330
2026/07/11 14:27:22 [debug] 7388#7388: *1842 writev: 785 of 785
2026/07/11 14:27:22 [debug] 7388#7388: *1842 chain writer out: 0000000000000000
2026/07/11 14:27:22 [debug] 7388#7388: *1842 event timer add: 15: 60000:235513964
2026/07/11 14:27:22 [debug] 7388#7388: *1842 http finalize request: -4, "/nextcloud/index.php/204?" a:1, c:2
2026/07/11 14:27:22 [debug] 7388#7388: *1842 http request count:2 blk:0
2026/07/11 14:27:22 [debug] 7388#7388: *1842 http run request: "/nextcloud/index.php/204?"
2026/07/11 14:27:22 [debug] 7388#7388: *1842 http upstream check client, write event:1, "/nextcloud/index.php/204"
2026/07/11 14:27:22 [debug] 7388#7388: timer delta: 9819
2026/07/11 14:27:22 [debug] 7388#7388: worker cycle
2026/07/11 14:27:22 [debug] 7388#7388: epoll timer: 55171
2026/07/11 14:27:22 [debug] 7388#7388: epoll: fd:15 ev:0004 d:00005575BAC0EA89
2026/07/11 14:27:22 [debug] 7388#7388: *1842 http upstream request: "/nextcloud/index.php/204?"
2026/07/11 14:27:22 [debug] 7388#7388: *1842 http upstream dummy handler
2026/07/11 14:27:22 [debug] 7388#7388: timer delta: 5
2026/07/11 14:27:22 [debug] 7388#7388: worker cycle
2026/07/11 14:27:22 [debug] 7388#7388: epoll timer: 55166
2026/07/11 14:27:22 [debug] 7388#7388: epoll: fd:15 ev:2015 d:00005575BAC0EA89
2026/07/11 14:27:22 [debug] 7388#7388: epoll_wait() error on fd:15 ev:2015
2026/07/11 14:27:22 [debug] 7388#7388: *1842 http upstream request: "/nextcloud/index.php/204?"
2026/07/11 14:27:22 [debug] 7388#7388: *1842 http upstream process header
2026/07/11 14:27:22 [debug] 7388#7388: *1842 malloc: 00005575BABFD2D0:4096
2026/07/11 14:27:22 [debug] 7388#7388: *1842 posix_memalign: 00005575BACD24E0:4096 @16
2026/07/11 14:27:22 [debug] 7388#7388: *1842 recv: eof:1, avail:-1
2026/07/11 14:27:22 [debug] 7388#7388: *1842 recv: fd:15 80 of 4096
2026/07/11 14:27:22 [debug] 7388#7388: *1842 http uwsgi status 404 "404 Not Found"
2026/07/11 14:27:22 [debug] 7388#7388: *1842 http uwsgi header: "Connection: close"
2026/07/11 14:27:22 [debug] 7388#7388: *1842 http uwsgi header: "Content-Type: text/plain"
2026/07/11 14:27:22 [debug] 7388#7388: *1842 http uwsgi header done
2026/07/11 14:27:22 [debug] 7388#7388: *1842 HTTP/1.1 404 Not Found
Server: nginx
Date: Sat, 11 Jul 2026 12:27:22 GMT
Content-Type: text/plain
Transfer-Encoding: chunked
Connection: keep-alive
Vary: Accept-Encoding
Referrer-Policy: no-referrer
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-Permitted-Cross-Domain-Policies: none
X-Robots-Tag: noindex, nofollow
Content-Encoding: gzip

2026/07/11 14:27:22 [debug] 7388#7388: *1842 write new buf t:1 f:0 00005575BACD27C0, pos 00005575BACD27C0, size: 369 file: 0, size: 0
2026/07/11 14:27:22 [debug] 7388#7388: *1842 http write filter: l:0 f:0 s:369
2026/07/11 14:27:22 [debug] 7388#7388: *1842 http cacheable: 0
2026/07/11 14:27:22 [debug] 7388#7388: *1842 http uwsgi filter init s:404 l:-1
2026/07/11 14:27:22 [debug] 7388#7388: *1842 http upstream process upstream
2026/07/11 14:27:22 [debug] 7388#7388: *1842 pipe read upstream: 1
2026/07/11 14:27:22 [debug] 7388#7388: *1842 pipe preread: 9
2026/07/11 14:27:22 [debug] 7388#7388: *1842 readv: eof:1, avail:0
2026/07/11 14:27:22 [debug] 7388#7388: *1842 readv: 1, last:4016
2026/07/11 14:27:22 [debug] 7388#7388: *1842 pipe recv chain: 0
2026/07/11 14:27:22 [debug] 7388#7388: *1842 pipe buf free s:0 t:1 f:0 00005575BABFD2D0, pos 00005575BABFD317, size: 9 file: 0, size: 0
2026/07/11 14:27:22 [debug] 7388#7388: *1842 pipe length: -1
2026/07/11 14:27:22 [debug] 7388#7388: *1842 input buf #0
2026/07/11 14:27:22 [debug] 7388#7388: *1842 pipe write downstream: 1
2026/07/11 14:27:22 [debug] 7388#7388: *1842 pipe write downstream flush in
2026/07/11 14:27:22 [debug] 7388#7388: *1842 http output filter "/nextcloud/index.php/204?"
2026/07/11 14:27:22 [debug] 7388#7388: *1842 http copy filter: "/nextcloud/index.php/204?"
2026/07/11 14:27:22 [debug] 7388#7388: *1842 http postpone filter "/nextcloud/index.php/204?" 00005575BAC08480
2026/07/11 14:27:22 [debug] 7388#7388: *1842 http gzip filter
2026/07/11 14:27:22 [debug] 7388#7388: *1842 malloc: 00005575BACF6CB0:270352
2026/07/11 14:27:22 [debug] 7388#7388: *1842 gzip alloc: n:1 s:5968 a:8192 p:00005575BACF6CB0
2026/07/11 14:27:22 [debug] 7388#7388: *1842 gzip alloc: n:32768 s:2 a:65536 p:00005575BACF8CB0
2026/07/11 14:27:22 [debug] 7388#7388: *1842 gzip alloc: n:32768 s:2 a:65536 p:00005575BAD08CB0
2026/07/11 14:27:22 [debug] 7388#7388: *1842 gzip alloc: n:32768 s:2 a:65536 p:00005575BAD18CB0
2026/07/11 14:27:22 [debug] 7388#7388: *1842 gzip alloc: n:16384 s:4 a:65536 p:00005575BAD28CB0
2026/07/11 14:27:22 [debug] 7388#7388: *1842 gzip in: 00005575BAC084A0
2026/07/11 14:27:22 [debug] 7388#7388: *1842 gzip in_buf:00005575BACD2A50 ni:00005575BABFD317 ai:9
2026/07/11 14:27:22 [debug] 7388#7388: *1842 malloc: 00005575BACD34F0:4096
2026/07/11 14:27:22 [debug] 7388#7388: *1842 deflate in: ni:00005575BABFD317 no:00005575BACD34F0 ai:9 ao:4096 fl:0 redo:0
2026/07/11 14:27:22 [debug] 7388#7388: *1842 deflate out: ni:00005575BABFD320 no:00005575BACD34FA ai:0 ao:4086 rc:0
2026/07/11 14:27:22 [debug] 7388#7388: *1842 gzip in_buf:00005575BACD2A50 pos:00005575BABFD317
2026/07/11 14:27:22 [debug] 7388#7388: *1842 gzip in: 0000000000000000
2026/07/11 14:27:22 [debug] 7388#7388: *1842 http copy filter: 0 "/nextcloud/index.php/204?"
2026/07/11 14:27:22 [debug] 7388#7388: *1842 pipe write downstream done
2026/07/11 14:27:22 [debug] 7388#7388: *1842 event timer: 15, old: 235513964, new: 235513969
2026/07/11 14:27:22 [debug] 7388#7388: *1842 http upstream exit: 0000000000000000
2026/07/11 14:27:22 [debug] 7388#7388: *1842 finalize http upstream request: 0
2026/07/11 14:27:22 [debug] 7388#7388: *1842 finalize http uwsgi request
2026/07/11 14:27:22 [debug] 7388#7388: *1842 free rr peer 1 0
2026/07/11 14:27:22 [debug] 7388#7388: *1842 close http upstream connection: 15
2026/07/11 14:27:22 [debug] 7388#7388: *1842 free: 00005575BABFE900, unused: 48
2026/07/11 14:27:22 [debug] 7388#7388: *1842 event timer del: 15: 235513964
2026/07/11 14:27:22 [debug] 7388#7388: *1842 reusable connection: 0
2026/07/11 14:27:22 [debug] 7388#7388: *1842 http upstream temp fd: -1
2026/07/11 14:27:22 [debug] 7388#7388: *1842 http output filter "/nextcloud/index.php/204?"
2026/07/11 14:27:22 [debug] 7388#7388: *1842 http copy filter: "/nextcloud/index.php/204?"
2026/07/11 14:27:22 [debug] 7388#7388: *1842 http postpone filter "/nextcloud/index.php/204?" 00007FFDBDC4F3C0
2026/07/11 14:27:22 [debug] 7388#7388: *1842 http gzip filter
2026/07/11 14:27:22 [debug] 7388#7388: *1842 gzip in: 00005575BAC084A0
2026/07/11 14:27:22 [debug] 7388#7388: *1842 gzip in_buf:00005575BACD2B70 ni:0000000000000000 ai:0
2026/07/11 14:27:22 [debug] 7388#7388: *1842 deflate in: ni:0000000000000000 no:00005575BACD34FA ai:0 ao:4086 fl:4 redo:0
2026/07/11 14:27:22 [debug] 7388#7388: *1842 deflate out: ni:0000000000000000 no:00005575BACD350D ai:0 ao:4067 rc:1
2026/07/11 14:27:22 [debug] 7388#7388: *1842 gzip in_buf:00005575BACD2B70 pos:0000000000000000
2026/07/11 14:27:22 [debug] 7388#7388: *1842 free: 00005575BACF6CB0
2026/07/11 14:27:22 [debug] 7388#7388: *1842 http chunk: 29
2026/07/11 14:27:22 [debug] 7388#7388: *1842 write old buf t:1 f:0 00005575BACD27C0, pos 00005575BACD27C0, size: 369 file: 0, size: 0
2026/07/11 14:27:22 [debug] 7388#7388: *1842 write new buf t:1 f:0 00005575BACD2C20, pos 00005575BACD2C20, size: 4 file: 0, size: 0
2026/07/11 14:27:22 [debug] 7388#7388: *1842 write new buf t:1 f:0 00005575BACD34F0, pos 00005575BACD34F0, size: 29 file: 0, size: 0
2026/07/11 14:27:22 [debug] 7388#7388: *1842 write new buf t:0 f:0 0000000000000000, pos 000055757CFDAF0C, size: 7 file: 0, size: 0
2026/07/11 14:27:22 [debug] 7388#7388: *1842 http write filter: l:1 f:1 s:409
2026/07/11 14:27:22 [debug] 7388#7388: *1842 http write filter limit 2097152
2026/07/11 14:27:22 [debug] 7388#7388: *1842 malloc: 00005575BACC5AD0:16384
2026/07/11 14:27:22 [debug] 7388#7388: *1842 SSL buf copy: 369
2026/07/11 14:27:22 [debug] 7388#7388: *1842 SSL buf copy: 4
2026/07/11 14:27:22 [debug] 7388#7388: *1842 SSL buf copy: 29
2026/07/11 14:27:22 [debug] 7388#7388: *1842 SSL buf copy: 7
2026/07/11 14:27:22 [debug] 7388#7388: *1842 SSL to write: 409
2026/07/11 14:27:22 [debug] 7388#7388: *1842 SSL_write: 409
2026/07/11 14:27:22 [debug] 7388#7388: *1842 http write filter 0000000000000000
2026/07/11 14:27:22 [debug] 7388#7388: *1842 http copy filter: 0 "/nextcloud/index.php/204?"
2026/07/11 14:27:22 [debug] 7388#7388: *1842 http finalize request: 0, "/nextcloud/index.php/204?" a:1, c:1
2026/07/11 14:27:22 [debug] 7388#7388: *1842 set http keepalive handler
2026/07/11 14:27:22 [debug] 7388#7388: *1842 http close request
2026/07/11 14:27:22 [debug] 7388#7388: *1842 http log handler
2026/07/11 14:27:22 [debug] 7388#7388: *1842 free: 00005575BACD34F0
2026/07/11 14:27:22 [debug] 7388#7388: *1842 free: 0000000000000000
2026/07/11 14:27:22 [debug] 7388#7388: *1842 free: 00005575BABFD2D0
2026/07/11 14:27:22 [debug] 7388#7388: *1842 free: 00005575BAAA3F90, unused: 0
2026/07/11 14:27:22 [debug] 7388#7388: *1842 free: 00005575BAC074D0, unused: 0
2026/07/11 14:27:22 [debug] 7388#7388: *1842 free: 00005575BACD24E0, unused: 1797
2026/07/11 14:27:22 [debug] 7388#7388: *1842 free: 00005575BAAA5E00
2026/07/11 14:27:22 [debug] 7388#7388: *1842 hc free: 0000000000000000
2026/07/11 14:27:22 [debug] 7388#7388: *1842 hc busy: 0000000000000000 0
2026/07/11 14:27:22 [debug] 7388#7388: *1842 free: 00005575BACC5AD0
2026/07/11 14:27:22 [debug] 7388#7388: *1842 reusable connection: 1
2026/07/11 14:27:22 [debug] 7388#7388: *1842 event timer add: 14: 65000:235518969
2026/07/11 14:27:22 [debug] 7388#7388: timer delta: 0
2026/07/11 14:27:22 [debug] 7388#7388: worker cycle
2026/07/11 14:27:22 [debug] 7388#7388: epoll timer: 55166

What I notice are the following lines

2026/07/11 14:27:22 [debug] 7388#7388: *1842 using configuration "\.php(?:$|/)"
2026/07/11 14:27:22 [debug] 7388#7388: *1842 http script copy: "DOCUMENT_ROOT"
2026/07/11 14:27:22 [debug] 7388#7388: *1842 http script var: "/usr/share/webapps"
2026/07/11 14:27:22 [debug] 7388#7388: *1842 uwsgi param: "DOCUMENT_ROOT: /usr/share/webapps"
2026/07/11 14:27:22 [debug] 7388#7388: *1842 connect to unix:/run/uwsgi/nextcloud.sock, fd:15 #1865

which looks sensible and

2026/07/11 14:27:22 [debug] 7388#7388: *1842 http upstream request: "/nextcloud/index.php/204?"

which has me wonder where the /204 comes from and whether that is expected or (part of) the problem.

Configuration

Nextcloud

occ config:list system

{
    "system": {
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "logfile": "\/var\/log\/nextcloud\/nextcloud.log",
        "apps_paths": [
            {
                "path": "\/usr\/share\/webapps\/nextcloud\/apps",
                "url": "\/apps",
                "writable": false
            },
            {
                "path": "\/var\/lib\/nextcloud\/apps",
                "url": "\/wapps",
                "writable": true
            }
        ],
        "trusted_domains": [
            "localhost",
            "mydomain"
        ],
        "overwrite.cli.url": "https:\/\/mydomain\/nextcloud\/",
        "htaccess.RewriteBase": "\/nextcloud\/",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "33.0.5.1",
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "maintenance_window_start": 2
    }
}

Nginx configuration

I found the suggestion to use include conf.d/*.conf convincing, otherwise vanilla. Commented lines expunged.

worker_processes  1;

include modules.d/*.conf;

events {
    worker_connections  1024;
}


http {
    include       mime.types;
    default_type  application/octet-stream;

    sendfile        on;
    keepalive_timeout  65;

    include conf.d/*.conf;

    server {
        listen       80;
        server_name  localhost;

        location / {
            root   /usr/share/nginx/html;
            index  index.html index.htm;
        }

        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   /usr/share/nginx/html;
        }
    }
}

Nextcloud-specific config taken from NGINX configuration — Nextcloud 35 Administration Manual and equipped with the uwsgi section from Nextcloud - ArchWiki – otherwise changed only in server_name etc:

# Nextcloud nginx configuration — subdirectory installation (/nextcloud)
# Version 2026-06-09



# Set the `immutable` cache control options only for assets with a cache busting `v` argument
map $arg_v $asset_immutable {
    "" "";
    default ", immutable";
}

server {
    listen 80;
    listen [::]:80;
    server_name anaphory.ddns.net;

    # Prevent nginx HTTP Server Detection
    server_tokens off;

    # Enforce HTTPS just for `/nextcloud`
    location /nextcloud {
        return 301 https://$server_name$request_uri;
    }
}

server {
    # With NGinx >= 1.25.1 you should use this instead:
    listen 443      ssl;
    listen [::]:443 ssl;
    http2 on;

    server_name anaphory.ddns.net;

    # Path to the root of the domain
    root /usr/share/webapps;

    # Use Mozilla's guidelines for SSL/TLS settings
    # https://mozilla.github.io/server-side-tls/ssl-config-generator/
    ssl_certificate     /etc/ssl/nginx/localhost.crt;
    ssl_certificate_key /etc/ssl/nginx/localhost.key;

    # Prevent nginx HTTP Server Detection
    server_tokens off;

    # Set .mjs and .wasm MIME types
    # Either include it in the default mime.types list
    # and include that list explicitly or add the file extension
    # only for Nextcloud like below:
    include mime.types;
    types {
        text/javascript mjs;
        # uncomment below for Nginx <= 1.21.0 
        # application/wasm wasm;
    }

    location = /robots.txt {
        allow all;
        log_not_found off;
        access_log off;
    }

    location ^~ /.well-known {
        # The rules in this block are an adaptation of the rules
        # in the Nextcloud `.htaccess` that concern `/.well-known`.

        location = /.well-known/carddav { return 301 /nextcloud/remote.php/dav/; }
        location = /.well-known/caldav  { return 301 /nextcloud/remote.php/dav/; }

        location /.well-known/acme-challenge    { try_files $uri $uri/ =404; }
        location /.well-known/pki-validation    { try_files $uri $uri/ =404; }

        # Let Nextcloud's API for `/.well-known` URIs handle all other
        # requests by passing them to the front-end controller.
        return 301 /nextcloud/index.php$request_uri;
    }

    location ^~ /nextcloud {
        # set max upload size and increase upload timeout:
        client_max_body_size 512M;
        client_body_timeout 300s;
        fastcgi_buffers 64 4K;

        # Proxy and client response timeouts
        # Uncomment an increase these if facing timeout errors during large file uploads
        #keepalive_timeout 60s;
        #proxy_connect_timeout 60s;
        #proxy_send_timeout 60s;
        #proxy_read_timeout 60s;
        #send_timeout 60s;

        # Enable gzip but do not remove ETag headers
        gzip on;
        gzip_vary on;
        gzip_comp_level 4;
        gzip_min_length 256;
        gzip_proxied expired no-cache no-store private no_last_modified no_etag auth;
        gzip_types application/atom+xml text/javascript application/javascript application/json application/ld+json application/manifest+json application/rss+xml application/vnd.geo+json application/vnd.ms-fontobject application/wasm application/x-font-ttf application/x-web-app-manifest+json application/xhtml+xml application/xml font/opentype image/bmp image/svg+xml image/x-icon text/cache-manifest text/css text/plain text/vcard text/vnd.rim.location.xloc text/vtt text/x-component text/x-cross-domain-policy;

        # Pagespeed is not supported by Nextcloud, so if your server is built
        # with the `ngx_pagespeed` module, uncomment this line to disable it.
        #pagespeed off;

        # The settings allows you to optimize the HTTP2 bandwidth.
        # See https://blog.cloudflare.com/delivering-http-2-upload-speed-improvements/
        # for tuning hints
        client_body_buffer_size 512k;

        # HSTS settings
        # WARNING: Only add the preload option once you read about
        # the consequences in https://hstspreload.org/. This option
        # will add the domain to a hardcoded list that is shipped
        # in all major browsers and getting removed from this list
        # could take several months.
        #add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always;

        # HTTP response headers borrowed from Nextcloud `.htaccess`
        add_header Referrer-Policy                   "no-referrer"       always;
        add_header X-Content-Type-Options            "nosniff"           always;
        add_header X-Frame-Options                   "SAMEORIGIN"        always;
        add_header X-Permitted-Cross-Domain-Policies "none"              always;
        add_header X-Robots-Tag                      "noindex, nofollow" always;

        # Remove X-Powered-By, which is an information leak
        fastcgi_hide_header X-Powered-By;

        # Specify how to handle directories -- specifying `/nextcloud/index.php$request_uri`
        # here as the fallback means that Nginx always exhibits the desired behaviour
        # when a client requests a path that corresponds to a directory that exists
        # on the server. In particular, if that directory contains an index.php file,
        # that file is correctly served; if it doesn't, then the request is passed to
        # the front-end controller. This consistent behaviour means that we don't need
        # to specify custom rules for certain paths (e.g. images and other assets,
        # `/updater`, `/ocs-provider`), and thus
        # `try_files $uri $uri/ /nextcloud/index.php$request_uri`
        # always provides the desired behaviour.
        index index.php index.html /nextcloud/index.php$request_uri;

        # Rule borrowed from `.htaccess` to handle Microsoft DAV clients
        location = /nextcloud {
            if ( $http_user_agent ~ ^DavClnt ) {
                return 302 /nextcloud/remote.php/webdav/$is_args$args;
            }
        }

        # Rules borrowed from `.htaccess` to hide certain paths from clients
        location ~ ^/nextcloud/(?:build|tests|config|lib|3rdparty|templates|data)(?:$|/)    { return 404; }
        location ~ ^/nextcloud/(?:\.|autotest|occ|issue|indie|db_|console)                  { return 404; }

        # Hide metadata files which would otherwise be served as plain files and
        # leak dependency information (composer.json, package.json, core/shipped.json).
        location ~ ^/nextcloud/(?:composer\.(?:json|lock)|package(?:-lock)?\.json|core/shipped\.json)$ { return 404; }

        # Pass PHP requests to PHP-FPM.
        #
        # Important: this block must appear above the static asset locations
        # below. Those locations fall back to `/nextcloud/index.php$request_uri`;
        # if they appear first, nginx can repeatedly rewrite to
        # `/nextcloud/index.php`, causing an internal redirection loop.
        location ~ \.php(?:$|/) {
            include uwsgi_params;
            uwsgi_modifier1 14;
            # Avoid duplicate headers confusing OC checks
            uwsgi_hide_header X-Frame-Options;
            uwsgi_hide_header X-XSS-Protection;
            uwsgi_hide_header X-Content-Type-Options;
            uwsgi_hide_header X-Robots-Tag;
            uwsgi_hide_header X-Download-Options;
            uwsgi_hide_header X-Permitted-Cross-Domain-Policies;
            uwsgi_pass unix:/run/uwsgi/nextcloud.sock;
        }

        # Serve static files
        location ~ \.(?:css|js|mjs|svg|gif|ico|jpg|png|webp|wasm|tflite|map|ogg|flac|mp4|webm)$ {
            try_files $uri /nextcloud/index.php$request_uri;
            # HTTP response headers borrowed from Nextcloud `.htaccess`
            add_header Cache-Control                     "public, max-age=15778463$asset_immutable";
            add_header Referrer-Policy                   "no-referrer"       always;
            add_header X-Content-Type-Options            "nosniff"           always;
            add_header X-Frame-Options                   "SAMEORIGIN"        always;
            add_header X-Permitted-Cross-Domain-Policies "none"              always;
            add_header X-Robots-Tag                      "noindex, nofollow" always;
            access_log off;     # Optional: Don't log access to assets
        }

        location ~ \.(otf|woff2?)$ {
            try_files $uri /nextcloud/index.php$request_uri;
            expires 7d;         # Cache-Control policy borrowed from `.htaccess`
            access_log off;     # Optional: Don't log access to assets
        }

        # Rule borrowed from `.htaccess`
        location /nextcloud/remote {
            return 301 /nextcloud/remote.php$request_uri;
        }

        location /nextcloud {
            try_files $uri $uri/ /nextcloud/index.php$request_uri;
        }
    }
}

uwsgi configuration

[uwsgi]
procname-master = %n
# change to php to use latest PHP
plugins = php_legacy
master = true
socket = /run/uwsgi/nextcloud.sock
# uncomment for a stats socket, that can be used with uwsgitop
# stats = /run/%n/%n-stats.sock
uid = nextcloud
gid = nextcloud
chown-socket = %(uid):http
chmod-socket = 660
processes = 10
cheaper = 4
cheaper-step = 1
idle = 600
die-on-idle = true

; reload whenever this config file changes
touch-reload = %p

cloud_data_dir = /var/lib/nextcloud/data
cloud_writable_apps_dir = /var/lib/nextcloud/apps
php_modules_dir = /usr/lib/php-legacy/modules
chdir = %(cloud_data_dir)

php-allowed-ext = .php
php-docroot = /usr/share/webapps/%n
php-index = index.php
php-set = date.timezone=Europe/Berlin
php-set = open_basedir=%(cloud_data_dir):%(cloud_writable_apps_dir):/var/lib/%n:/tmp/:/usr/share/webapps/%n:/etc/webapps/%n:/dev/urandom:%(php_modules_dir):/run/redis/redis.sock:/var/log/%n/%n.log:/proc/meminfo
php-set = session.save_path=/tmp
php-set = session.gc_maxlifetime  21600
php-set = session.gc_divisor  500
php-set = session.gc_probability  1
php-set = post_max_size=1000M
php-set = upload_max_filesize=1000M
php-set = always_populate_raw_post_data=-1
php-set = max_input_time=120
php-set = max_execution_time=60
php-set = memory_limit=768M
php-set = zend_extension=opcache
php-set = opcache.enable=1
php-set = opcache.enable_cli=1
php-set = opcache.interned_strings_buffer=8
php-set = opcache.max_accelerated_files=10000
php-set = opcache.memory_consumption=128
php-set = opcache.save_comments=1
php-set = opcache.revalidate_freq=1

# uncomment if php-apcu is installed and used
# php-set = extension=apcu
php-set = extension=bcmath
php-set = extension=bz2
php-set = extension=curl
php-set = extension=exif
php-set = extension=ftp
php-set = extension=gd
php-set = extension=gmp
# uncomment if php-imagick is installed and used
php-set = extension=imagick
php-set = extension=intl
php-set = extension=iconv
php-set = extension=ldap
# uncomment if php-memcached is installed and used
# php-set = extension=memcached
php-set = extension=pdo_mysql
# uncomment if php-pgsql is installed and used
# php-set = extension=pdo_pgsql
php-set = extension=pdo_sqlite
# uncomment if php-igbinary is installed and used
# php-set = extension=igbinary
# uncomment if php-redis is installed and used (requires php-igbinary)
# php-set = extension=redis
php-set = extension=sockets
php-set = extension=sysvsem
# uncomment if php-xsl is installed and used
# php-set = extension=xsl
php-set = extension=zip

# change the URL to your own address and uncomment to run a webcron job every five minutes
# cron = -5 -1 -1 -1 -1 curl --silent https://change.me.tld/cron.php 1>/dev/null

# uncomment to run a cron job every five minutes
# cron = -5 -1 -1 -1 -1 php-legacy -f /usr/share/webapps/%n/cron.php

The uwsgi docroot wasn’t changed yet to account for the directory Nextcloud is served to:

Changing this to

php-docroot = /usr/share/webapps/

makes it all run properly.