Error 404 on media routes in Panel - Nginx server

Hi there,
I’m having issues with some routes on the Panel as I moved my website from a local Apache server to a remote Nginx server.
Plugins assets and images give a 404 error and I can’t find how to solve this. Do you have any idea what could be the issue here?

What does your Nginx config look like, compared to a recommended setup like described here: Kirby meets Nginx | Kirby CMS

This is what the nginx config looks like (I’m not handling the server myself, I’m not sure why it looks like that exactly):

server {
    listen       80 proxy_protocol;
    listen       [::]:80 proxy_protocol;
    server_name  localhost;
    root         /.../.../public;

    index index.html index.htm index.php;

    set_real_ip_from 192.168.3.11;
    set_real_ip_from 192.168.3.12;
    real_ip_header proxy_protocol;
    real_ip_recursive on;

    rewrite ^\/(content|site|kirby)/(.*)$ /error last;

    location = /favicon.ico {
        log_not_found off;
        access_log off;
    }

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

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

    location ~ \.php$ {
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto https;
        proxy_set_header Proxy "";
        proxy_pass_header Server;

        try_files $fastcgi_script_name =404;

        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param HTTPS on;

        fastcgi_param front_controller_active true;     # Enable pretty urls

        fastcgi_intercept_errors on;
        fastcgi_request_buffering off;

        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass unix:/var/run/php/php8.1.sock;
        fastcgi_index index.php;
    }

    location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
        expires max;
        log_not_found off;
    }
}