Moving server – Panel not loading and images not found

Hi all,

I’ve moved everything to the new (VPS) host and it seems to be half working. After a bunch of reading, testing, reinstalling and pulling hair I’m still baffled.

Images
Non of the images are showing up.
Media and cache folders were not transferred.
Media and cache folders are being created automatically.
Using this page to test for images not showing.

Panel
Not loading the page.
Transfers to [domain]/panel/login
Page is blank with a ‘too many redirects’ error

Notes
The new host is running NGINX and I’ve followed the instructions. The site seems to be working apart from the issues above.

I’ve converted my .htaccess file to NGINX format.

Temp staging site is at kiakamgar.net

This is the extract that’s working so far…

default_type text/plain;
add_header X-Content-Type-Options nosniff;

rewrite ^/(content|site|kirby)/(.*)$ /error last;rewrite ^/.(?!well-known/) /error last;rewrite ^/(?!app.webmanifest)[^/]+$ /index.php last;

location / {try_files $uri $uri/ /index.php$is_args$args;}

location ~* .php$ {
try_files $uri =404;
fastcgi_pass 127.0.0.1:9000;
include fastcgi.conf;
fastcgi_split_path_info ^(.+.php)(/.+)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SERVER_PORT 80;

Any help in the right direction would be grand!

I managed to figure out the Panel not loading issue by checking directory permissions, so not that’s all working.

But the images not showing up problem still persists. This is after deleting the /media and /cache folders.

Also found this post about the .jobs problem I’ve just noticed in my /media directories, so trying to see how I can fix this.

Ok, after a BUNCH of testing and EVEN MORE researching.

This helped…

Once I comment this (see below) out on my NGINX config file, all working.

location ~* ^.+\.(css|js|jpg|jpeg|gif|png|ico|gz|svg|svgz|ttf|otf|woff|woff2|eot|mp4|ogg|ogv|webm|webp|zip|swf|map|mjs)$ {
    try_files $uri $uri/ /index.php$is_args$args;
    add_header Access-Control-Allow-Origin "*";
    add_header alt-svc 'h3=":443"; ma=86400';
    expires max;
    access_log off;
  }

Now the question is… how can I have caching for those files without messing with the images not being rendered?