Trying the approach Matt shows here:
matcher notStatic {
not {
file {
try_files {path}
}
}
}
try_files /index.php?p={path}&{query}
reverse_proxy match:notStatic {
to unix//run/php/php7.3-fpm.sock
transport fastcgi {
split .php
}
}
file_server
/blog
is 404.
Trying a rewrite
:
matcher notStatic {
not {
file {
try_files {path}
}
}
}
rewrite match:notStatic /index.php?p={path}&{query}
reverse_proxy match:notStatic {
to unix//run/php/php7.3-fpm.sock
transport fastcgi {
split .php
}
}
file_server
This sends unprocessed PHP code with a status response of 200:
<?php
/**
* Craft web bootstrap file
*/
// Set path constants
define('CRAFT_BASE_PATH', dirname(__DIR__));
define('CRAFT_VENDOR_PATH', CRAFT_BASE_PATH.'/vendor');
// Load Composer's autoloader
require_once CRAFT_VENDOR_PATH.'/autoload.php';
// Load dotenv?
if (class_exists('Dotenv\Dotenv') && file_exists(CRAFT_BASE_PATH.'/.env')) {
(new Dotenv\Dotenv(CRAFT_BASE_PATH))->load();
}
// Load and run Craft
define('CRAFT_ENVIRONMENT', getenv('ENVIRONMENT') ?: 'production');
$app = require CRAFT_VENDOR_PATH.'/craftcms/cms/bootstrap/web.php';
$app->run();