I have the same problem as described in this thread, Cannot read property 'name' of undefined
However, I don’t use cloudflare, so it can’t be that. I am guessing it might have something to do with HTTP PATCH (see my post here Kirby 3: The form could not be saved, check your API connection ) , as I can also not delete an uploaded images.
if I click on the link in the “status of 404 ()”, it shows
{"status":"error","route":"(.*)\/files\/([a-zA-Z0-9\\.\\-_%= \\+\\@\\(\\)]+)","exception":"Kirby\\Exception\\PermissionException","message":"Unauthenticated","key":"error.permission","file":"kirby\/config\/api\/authentication.php","line":12,"details":[],"code":403}
my error log shows
2019/10/02 13:52:11 [error] 1251#1251: *1 open() "/var/www/servers/xxxx-my-domain-xxxx/html/api/pages/project/files/app_daily_v2.png" failed (2: No such file or directory), client: xx.xxx.xx.xx, server: xxxx-my-domain-xxxx, request: "GET /api/pages/project/files/app_daily_v2.png?view=panel HTTP/2.0", host: "xxxx-my-domain-xxxx", referrer: "https://xxxx-my-domain-xxxx/panel/pages/project/files/app_daily_v2.png"
Am on NGINX with php 7.3
Hm, deleting and uploading pages doesn’t use the PATCH request, but POST. Can you do anything in the Panel?
Okay, thanks texnixe. Everything else seems to be okay in the panel. I can upload images, I can delete pages, even one that have images uploaded to them. I just cant edit uploaded images (to add alt tags etc), nor delete them via the panel.
Have you tested this with a fresh 3.2.5 Starterkit?
Nope, on 3.2.3 the moment, but I’ll do a test with that and get back to you.
1 Like
okay, so here’s the story.
I updated to 3.2.5 -> no difference.
I installed 3.2.5 on a different server also running nginx (but with a different version) -> no difference
then I had another look at my nginx config for the site and removed this entry
location ~ \.(jpe?g|gif|png|webp|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc)$ {
expires 1M;
access_log off;
add_header Cache-Control "public";
}
I had initially added it after reading this thread: Nginx install and "The panel cannot connect to the API" problem , which is kind of funny because for me (on 2 nginx servers) it actually created this problem. I am not quite sure why this is the case. If anyone can enlighten me?
Anyway, happy now
The final solution can be found here
So, finally, I managed to fix this problem, with the help of @Philip (see above) and this post (Nginix server config ) by natropo.
Here my nginx configuration (note that the order of directives is important!)
# removes trailing slashes (prevents SEO duplicate content issues)
if (!-d $request_filename) {
rewrite ^/(.+)/$ /$1 permanent;
}
# Don't hint these as folders
rewrite ^/(content|kirby|site|vendor)\/?$ /error last;
# Block content
rewrite ^/content/(.*).…