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`. ...@@ -44,6 +44,7 @@ Use `SITE_mycard.moe: php://fpm.example.com:9000/path/to/site`.
- `INDEX` Specify index file. Default `index.php`. - `INDEX` Specify index file. Default `index.php`.
- `EXPIRES` Specify expires time. Default `10m`. - `EXPIRES` Specify expires time. Default `10m`.
- `PHP_EXTRA` Extra entry in `location`.
### Global ### Global
......
...@@ -50,6 +50,7 @@ export interface StaticRenderData extends FileRenderData { ...@@ -50,6 +50,7 @@ export interface StaticRenderData extends FileRenderData {
export interface PhpRenderData extends FileRenderData { export interface PhpRenderData extends FileRenderData {
php: true; php: true;
upstream: string; upstream: string;
phpExtra?: string[];
} }
export type SpecificRenderData = PhpRenderData | StaticRenderData | ProxyRenderData; export type SpecificRenderData = PhpRenderData | StaticRenderData | ProxyRenderData;
...@@ -113,6 +114,7 @@ async function getSiteData( ...@@ -113,6 +114,7 @@ async function getSiteData(
index: parser.getString('INDEX') || 'index.php', index: parser.getString('INDEX') || 'index.php',
expires: parser.getString('EXPIRES') || '10m', expires: parser.getString('EXPIRES') || '10m',
upstream: targetUrl.host, upstream: targetUrl.host,
phpExtra: parser.getArray('PHP_EXTRA'),
} as PhpRenderData; } as PhpRenderData;
} else { } else {
specificRenderData = { specificRenderData = {
......
...@@ -273,6 +273,9 @@ http { ...@@ -273,6 +273,9 @@ http {
{{#https}} {{#https}}
fastcgi_param HTTPS on; fastcgi_param HTTPS on;
{{/https}} {{/https}}
{{#phpExtra}}
{{.}}
{{/phpExtra}}
} }
{{/php}} {{/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