Here is the debug log for the /remote.php/dav request without the matcher and rewrite directive:
{
"level": "debug",
"ts": 1619856201.439723,
"logger": "http.handlers.rewrite",
"msg": "rewrote request",
"request": {
"remote_addr": "IP:50349",
"proto": "HTTP/2.0",
"method": "GET",
"host": "sub.domain.com",
"uri": "/remote.php/dav",
"headers": {
"Te": [
"trailers"
],
"User-Agent": [
"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:88.0) Gecko/20100101 Firefox/88.0"
],
"Dnt": [
"1"
],
"Upgrade-Insecure-Requests": [
"1"
],
"Cookie": [
"oc_sessionPassphrase=kO1aaj79QDEsiYQ%2BBqKrHbcc79MxZwGS4GRulm1%2Bxk7FnAMcLj8PH6Pagx5G%2BtJSfAcXiUnZHdsVTqltQ%2BxPem0EezWpZ0L%2BcS0BuaXfDfIM7qK5XBT1JPe4bhHRJUbJ; oc8nqiyqfk0m=41u5uqu22atm7iako806uvaav9; __Host-nc_sameSiteCookielax=true; __Host-nc_sameSiteCookiestrict=true; nc_username=tllggrs; nc_token=zfaRSuiAL8qCWZF%2FeN0NEbU8ce2E32fR; nc_session_id=41u5uqu22atm7iako806uvaav9"
],
"Cache-Control": [
"max-age=0"
],
"Accept": [
"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8"
],
"Accept-Language": [
"de,en-US;q=0.7,en;q=0.3"
],
"Accept-Encoding": [
"gzip, deflate, br"
]
},
"tls": {
"resumed": false,
"version": 772,
"cipher_suite": 4865,
"proto": "h2",
"proto_mutual": true,
"server_name": "sub.domain.com"
}
},
"method": "GET",
"uri": "/remote.php"
}
{
"level": "debug",
"ts": 1619856201.4399064,
"logger": "http.reverse_proxy.transport.fastcgi",
"msg": "roundtrip",
"request": {
"remote_addr": "IP:50349",
"proto": "HTTP/2.0",
"method": "GET",
"host": "sub.domain.com",
"uri": "/remote.php",
"headers": {
"User-Agent": [
"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:88.0) Gecko/20100101 Firefox/88.0"
],
"Dnt": [
"1"
],
"Upgrade-Insecure-Requests": [
"1"
],
"Te": [
"trailers"
],
"X-Forwarded-For": [
"IP"
],
"X-Forwarded-Proto": [
"https"
],
"Accept": [
"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8"
],
"Accept-Language": [
"de,en-US;q=0.7,en;q=0.3"
],
"Accept-Encoding": [
"gzip, deflate, br"
],
"Cookie": [
"oc_sessionPassphrase=kO1aaj79QDEsiYQ%2BBqKrHbcc79MxZwGS4GRulm1%2Bxk7FnAMcLj8PH6Pagx5G%2BtJSfAcXiUnZHdsVTqltQ%2BxPem0EezWpZ0L%2BcS0BuaXfDfIM7qK5XBT1JPe4bhHRJUbJ; oc8nqiyqfk0m=41u5uqu22atm7iako806uvaav9; __Host-nc_sameSiteCookielax=true; __Host-nc_sameSiteCookiestrict=true; nc_username=tllggrs; nc_token=zfaRSuiAL8qCWZF%2FeN0NEbU8ce2E32fR; nc_session_id=41u5uqu22atm7iako806uvaav9"
],
"Cache-Control": [
"max-age=0"
]
},
"tls": {
"resumed": false,
"version": 772,
"cipher_suite": 4865,
"proto": "h2",
"proto_mutual": true,
"server_name": "sub.domain.com"
}
},
"dial": "/var/run/php/php8.0-fpm.sock",
"env": {
"AUTH_TYPE": "",
"CONTENT_LENGTH": "",
"CONTENT_TYPE": "",
"DOCUMENT_ROOT": "/var/www/nextcloud",
"DOCUMENT_URI": "/remote.php",
"GATEWAY_INTERFACE": "CGI/1.1",
"HTTPS": "on",
"HTTP_ACCEPT": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
"HTTP_ACCEPT_ENCODING": "gzip, deflate, br",
"HTTP_ACCEPT_LANGUAGE": "de,en-US;q=0.7,en;q=0.3",
"HTTP_CACHE_CONTROL": "max-age=0",
"HTTP_COOKIE": "oc_sessionPassphrase=kO1aaj79QDEsiYQ%2BBqKrHbcc79MxZwGS4GRulm1%2Bxk7FnAMcLj8PH6Pagx5G%2BtJSfAcXiUnZHdsVTqltQ%2BxPem0EezWpZ0L%2BcS0BuaXfDfIM7qK5XBT1JPe4bhHRJUbJ; oc8nqiyqfk0m=41u5uqu22atm7iako806uvaav9; __Host-nc_sameSiteCookielax=true; __Host-nc_sameSiteCookiestrict=true; nc_username=tllggrs; nc_token=zfaRSuiAL8qCWZF%2FeN0NEbU8ce2E32fR; nc_session_id=41u5uqu22atm7iako806uvaav9",
"HTTP_DNT": "1",
"HTTP_HOST": "sub.domain.com",
"HTTP_TE": "trailers",
"HTTP_UPGRADE_INSECURE_REQUESTS": "1",
"HTTP_USER_AGENT": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:88.0) Gecko/20100101 Firefox/88.0",
"HTTP_X_FORWARDED_FOR": "IP",
"HTTP_X_FORWARDED_PROTO": "https",
"PATH": "/bin",
"PATH_INFO": "/dav",
"PATH_TRANSLATED": "/var/www/nextcloud/dav",
"QUERY_STRING": "",
"REMOTE_ADDR": "IP",
"REMOTE_HOST": "IP",
"REMOTE_IDENT": "",
"REMOTE_PORT": "50349",
"REMOTE_USER": "",
"REQUEST_METHOD": "GET",
"REQUEST_SCHEME": "https",
"REQUEST_URI": "/remote.php/dav",
"SCRIPT_FILENAME": "/var/www/nextcloud/remote.php",
"SCRIPT_NAME": "/remote.php",
"SERVER_NAME": "sub.domain.com",
"SERVER_PROTOCOL": "HTTP/2.0",
"SERVER_SOFTWARE": "Caddy/v2.4.0-beta.2",
"SSL_CIPHER": "TLS_AES_128_GCM_SHA256",
"SSL_PROTOCOL": "TLSv1.3",
"front_controller_active": "true"
}
}
{
"level": "debug",
"ts": 1619856201.4403615,
"logger": "http.handlers.reverse_proxy",
"msg": "upstream roundtrip",
"upstream": "unix//var/run/php/php8.0-fpm.sock",
"request": {
"remote_addr": "IP:50349",
"proto": "HTTP/2.0",
"method": "GET",
"host": "sub.domain.com",
"uri": "/remote.php",
"headers": {
"Accept": [
"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8"
],
"Accept-Language": [
"de,en-US;q=0.7,en;q=0.3"
],
"Accept-Encoding": [
"gzip, deflate, br"
],
"Cookie": [
"oc_sessionPassphrase=kO1aaj79QDEsiYQ%2BBqKrHbcc79MxZwGS4GRulm1%2Bxk7FnAMcLj8PH6Pagx5G%2BtJSfAcXiUnZHdsVTqltQ%2BxPem0EezWpZ0L%2BcS0BuaXfDfIM7qK5XBT1JPe4bhHRJUbJ; oc8nqiyqfk0m=41u5uqu22atm7iako806uvaav9; __Host-nc_sameSiteCookielax=true; __Host-nc_sameSiteCookiestrict=true; nc_username=tllggrs; nc_token=zfaRSuiAL8qCWZF%2FeN0NEbU8ce2E32fR; nc_session_id=41u5uqu22atm7iako806uvaav9"
],
"Cache-Control": [
"max-age=0"
],
"User-Agent": [
"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:88.0) Gecko/20100101 Firefox/88.0"
],
"Dnt": [
"1"
],
"Upgrade-Insecure-Requests": [
"1"
],
"Te": [
"trailers"
],
"X-Forwarded-For": [
"IP"
],
"X-Forwarded-Proto": [
"https"
]
},
"tls": {
"resumed": false,
"version": 772,
"cipher_suite": 4865,
"proto": "h2",
"proto_mutual": true,
"server_name": "sub.domain.com"
}
},
"duration": 0.000545987,
"headers": {
"Status": [
"403 Forbidden"
],
"Content-Type": [
"text/html; charset=UTF-8"
]
},
"status": 403
}
I see
"PATH_INFO": "/dav",
"PATH_TRANSLATED": "/var/www/nextcloud/dav",
and think that could be an issue because path translated doesn’t exist in that way. But i don’t know what to fix because fpm seems to get a hiccup between calling root/remote.php and root/dav. There is no dav folder in nextcloud 21 root folder, i checked.