Page 1 of 1

/api/jupload 404 (Not found) (Nginx web server)

Posted: Wed Sep 28, 2022 12:06 am
by melcv

I'm trying to upload a photo (v2023) but I get this error server side:

Slim Application Error Type: RuntimeException Code: 0 Message: Invalid CSRF storage. Use session_start() before instantiating the Guard

And i get this error:
Not Found Type: Slim\Exception\HttpNotFoundException Code: 404 Message: Route 'imagenes/undefined' not found. File: /var/www/torneos/src/routes.php Line: 203

And on client side:
Uncaught TypeError: Cannot read properties of undefined (reading '0') at HTMLInputElement.<anonymous> (ew.js:8843:23)

/api/jupload 404 (Not found) jquery.min.js?v=19.0.4:2

Can someone help me please?


Re: Invalid CSRF storage - Upload

Posted: Wed Sep 28, 2022 8:25 am
by arbei

Are you sure you have set up URL Rewrite properly?


Re: Invalid CSRF storage - Upload

Posted: Thu Sep 29, 2022 1:51 am
by melcv

I'm using nginx and this is my configuration:

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

  location ~ \.php$ {

fastcgi_split_path_info ^(.+\.php)(/.+)$;
    include snippets/fastcgi-php.conf;
    fastcgi_intercept_errors on;
    fastcgi_pass php_torneo;

  }

server {
  listen 80;
  listen [::]:80;

  server_name torneos.ec www.torneos.ec ;

 return 301 https://torneos.ec$request_uri;
}


server {
  listen 443 ssl http2;
  listen [::]:443 ssl http2;

  server_name www.torneos.ec ;

  return 301 https://torneos.ec$request_uri;
}

location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
    expires max;
    #add_header Access-Control-Allow-Origin *;
    log_not_found off;
  }

Re: Invalid CSRF storage - Upload

Posted: Thu Sep 29, 2022 10:07 am
by arbei

You may refer to the sample Nginx configuration file and adjust yours.