Google App Engine Standard & Slim : configuration?


I’m trying to move from Google App Engine Flex to Google App Engine standard.
I use Slim to provide a REST Api to my AngularJs application.

I want to serve call like

For google App Engine Flex, I used a nginx-app.conf so that it works :

(this is a working conf for GAE Flex)

location / {
  # try to serve file directly, fallback to front controller
  try_files $uri /index.html$is_args$args;
location /rest {
  # try to serve file directly, fallback to front controller
  try_files $uri /rest/index.php$is_args$args;

location ~ \.php {
    try_files $uri =404;
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    include fastcgi_params;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_param SCRIPT_NAME $fastcgi_script_name;
    fastcgi_index index.php;

Now, what am I supposed to do so that Slim is working one GAE Standard ?
nginx-app.conf seems to be ignored, and it’s purpose was to rewrite

Currently, I’m getting 404 error, using

runtime: php72
entrypoint: serve public/rest/index.php


it seems that GAE Standard does not provide rewriting features…

I’m trying to make a simple implementation of the mod rewrite suggestion.
I feel it’s not far from working, but I’ve a weird behavior


$path = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
$_SERVER['REQUEST_URI']= substr($path, strlen("/rest"));
require "index.php";

With the code above

$request->getUri()->getPath ();

return :


While I’m expecting to have the following returned


If I use :

$request->getUri()->getPath ();

return this


if I use

$_SERVER['REQUEST_URI']= substr($path, strlen("/rest/")); notice the trailing '/' of the strlen
$request->getUri()->getPath ();



and this last, I really don’t understand, I’ve dig in Slim code

$path = "/rest/authenticate";
$query = substr($path, strlen("/rest/"));

 echo preg_replace_callback(
            function ($match) {
                return rawurlencode($match[0]);

the pre_reg stuff is from filterQuery() from URI.php of slimframework.
And this returns “authenticate” as I’m expecting.

I end up updating my application to take the fact that on GAE, the REQUEST_URI is prefixed by /rest/ while on my local Apache, it’s not.