Commit 92f5010b authored by nanahira's avatar nanahira

add PHP_EXTRA

parent 31e8b717
Pipeline #21211 passed with stages
in 12 minutes and 56 seconds
......@@ -44,6 +44,7 @@ Use `SITE_mycard.moe: php://fpm.example.com:9000/path/to/site`.
- `INDEX` Specify index file. Default `index.php`.
- `EXPIRES` Specify expires time. Default `10m`.
- `PHP_EXTRA` Extra entry in `location`.
### Global
......
......@@ -50,6 +50,7 @@ export interface StaticRenderData extends FileRenderData {
export interface PhpRenderData extends FileRenderData {
php: true;
upstream: string;
phpExtra?: string[];
}
export type SpecificRenderData = PhpRenderData | StaticRenderData | ProxyRenderData;
......@@ -113,6 +114,7 @@ async function getSiteData(
index: parser.getString('INDEX') || 'index.php',
expires: parser.getString('EXPIRES') || '10m',
upstream: targetUrl.host,
phpExtra: parser.getArray('PHP_EXTRA'),
} as PhpRenderData;
} else {
specificRenderData = {
......
......@@ -273,6 +273,9 @@ http {
{{#https}}
fastcgi_param HTTPS on;
{{/https}}
{{#phpExtra}}
{{.}}
{{/phpExtra}}
}
{{/php}}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment