Commit 5eba5882 authored by nanahira's avatar nanahira

add HTTP_EXTRA_PRE and NGINX_EXTRA_PRE

parent 031392ce
Pipeline #38613 failed with stages
in 58 minutes and 4 seconds
...@@ -60,3 +60,5 @@ Use `SITE_mycard.moe: redirect+https://example.com`. ...@@ -60,3 +60,5 @@ Use `SITE_mycard.moe: redirect+https://example.com`.
- `LIMIT_RATE` `LIMIT_BURST` `MAX_CACHE_SIZE` in original format. eg. `LIMIT_RATE=10m` - `LIMIT_RATE` `LIMIT_BURST` `MAX_CACHE_SIZE` in original format. eg. `LIMIT_RATE=10m`
- `HTTP_EXTRA` Extra entry in `http` section. - `HTTP_EXTRA` Extra entry in `http` section.
- `NGINX_EXTRA` Extra entry in `nginx.conf` section. - `NGINX_EXTRA` Extra entry in `nginx.conf` section.
- `HTTP_EXTRA_PRE` Extra entry in `http` section, before every sites.
- `NGINX_EXTRA_PRE` Extra entry in `nginx.conf` section, before `http` section.
...@@ -86,6 +86,8 @@ export interface RenderData { ...@@ -86,6 +86,8 @@ export interface RenderData {
upstreams: Upstream[]; upstreams: Upstream[];
httpExtra?: string[]; httpExtra?: string[];
nginxExtra?: string[]; nginxExtra?: string[];
httpExtraPre?: string[];
nginxExtraPre?: string[];
} }
export interface Upstream { export interface Upstream {
...@@ -248,5 +250,7 @@ export async function getData( ...@@ -248,5 +250,7 @@ export async function getData(
upstreams, upstreams,
httpExtra: parser.getArray('HTTP_EXTRA'), httpExtra: parser.getArray('HTTP_EXTRA'),
nginxExtra: parser.getArray('NGINX_EXTRA'), nginxExtra: parser.getArray('NGINX_EXTRA'),
httpExtraPre: parser.getArray('HTTP_EXTRA_PRE'),
nginxExtraPre: parser.getArray('NGINX_EXTRA_PRE'),
}; };
} }
...@@ -8,6 +8,10 @@ events { ...@@ -8,6 +8,10 @@ events {
# multi_accept on; # multi_accept on;
} }
{{#nginxExtraPre}}
{{.}}
{{/nginxExtraPre}}
http { http {
## ##
...@@ -140,6 +144,10 @@ http { ...@@ -140,6 +144,10 @@ http {
limit_rate {{.}}; limit_rate {{.}};
{{/limitRate}} {{/limitRate}}
{{#httpExtraPre}}
{{.}}
{{/httpExtraPre}}
## ##
# Upstreams # Upstreams
## ##
...@@ -312,11 +320,11 @@ http { ...@@ -312,11 +320,11 @@ http {
} }
{{/sites}} {{/sites}}
include /etc/nginx/conf.d/*.conf; {{#httpExtra}}
{{.}}
{{/httpExtra}}
{{#httpExtra}} include /etc/nginx/conf.d/*.conf;
{{.}}
{{/httpExtra}}
} }
stream { stream {
......
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