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`.
- `LIMIT_RATE` `LIMIT_BURST` `MAX_CACHE_SIZE` in original format. eg. `LIMIT_RATE=10m`
- `HTTP_EXTRA` Extra entry in `http` 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 {
upstreams: Upstream[];
httpExtra?: string[];
nginxExtra?: string[];
httpExtraPre?: string[];
nginxExtraPre?: string[];
}
export interface Upstream {
......@@ -248,5 +250,7 @@ export async function getData(
upstreams,
httpExtra: parser.getArray('HTTP_EXTRA'),
nginxExtra: parser.getArray('NGINX_EXTRA'),
httpExtraPre: parser.getArray('HTTP_EXTRA_PRE'),
nginxExtraPre: parser.getArray('NGINX_EXTRA_PRE'),
};
}
......@@ -8,6 +8,10 @@ events {
# multi_accept on;
}
{{#nginxExtraPre}}
{{.}}
{{/nginxExtraPre}}
http {
##
......@@ -140,6 +144,10 @@ http {
limit_rate {{.}};
{{/limitRate}}
{{#httpExtraPre}}
{{.}}
{{/httpExtraPre}}
##
# Upstreams
##
......@@ -312,11 +320,11 @@ http {
}
{{/sites}}
include /etc/nginx/conf.d/*.conf;
{{#httpExtra}}
{{.}}
{{/httpExtra}}
{{#httpExtra}}
{{.}}
{{/httpExtra}}
include /etc/nginx/conf.d/*.conf;
}
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