unplugin-https-reverse-proxy 2.0.3-beta.1 → 2.0.3-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-6ESO3Y2K.js → chunk-XGTVAT6M.js} +8 -9
- package/dist/esbuild.cjs +8 -9
- package/dist/esbuild.js +1 -1
- package/dist/index.cjs +8 -9
- package/dist/index.js +1 -1
- package/dist/nuxt.cjs +8 -9
- package/dist/nuxt.js +1 -1
- package/dist/rollup.cjs +8 -9
- package/dist/rollup.js +1 -1
- package/dist/rspack.cjs +8 -9
- package/dist/rspack.js +1 -1
- package/dist/types.d.cts +1 -0
- package/dist/types.d.ts +1 -0
- package/dist/vite.cjs +8 -9
- package/dist/vite.js +1 -1
- package/dist/webpack.cjs +8 -9
- package/dist/webpack.js +1 -1
- package/package.json +1 -1
- package/src/caddy/caddyfile.ts +3 -6
- package/src/caddy/index.ts +3 -0
- package/src/types.ts +1 -0
|
@@ -13355,7 +13355,8 @@ var ProxyType = type({
|
|
|
13355
13355
|
port_suffix: "string",
|
|
13356
13356
|
tls: "string",
|
|
13357
13357
|
source: "string",
|
|
13358
|
-
base: "string"
|
|
13358
|
+
base: "string",
|
|
13359
|
+
health_check: "boolean"
|
|
13359
13360
|
});
|
|
13360
13361
|
var CaddyContext = type({
|
|
13361
13362
|
caddy_root: "string",
|
|
@@ -13393,7 +13394,7 @@ var caddyTemplate = `{
|
|
|
13393
13394
|
{% for p in proxies %}
|
|
13394
13395
|
{{ p.target }}{{ p.port_suffix }} {
|
|
13395
13396
|
{{ p.tls }}
|
|
13396
|
-
reverse_proxy http://{{ p.source }} {
|
|
13397
|
+
reverse_proxy http://{{ p.source }} {% if p.health_check %} {
|
|
13397
13398
|
health_uri {{ p.base }}
|
|
13398
13399
|
health_interval 2s
|
|
13399
13400
|
health_timeout 5s
|
|
@@ -13401,11 +13402,6 @@ var caddyTemplate = `{
|
|
|
13401
13402
|
unhealthy_status 502 503 504 404
|
|
13402
13403
|
lb_try_duration 3s
|
|
13403
13404
|
lb_try_interval 300ms
|
|
13404
|
-
health_headers {
|
|
13405
|
-
Accept text/html
|
|
13406
|
-
Accept-Encoding gzip, deflate, br
|
|
13407
|
-
User-Agent Caddy-Health-Check
|
|
13408
|
-
}
|
|
13409
13405
|
|
|
13410
13406
|
@error status 502 503 504 404
|
|
13411
13407
|
handle_response @error {
|
|
@@ -13415,6 +13411,7 @@ var caddyTemplate = `{
|
|
|
13415
13411
|
}
|
|
13416
13412
|
}
|
|
13417
13413
|
}
|
|
13414
|
+
{% endif %}
|
|
13418
13415
|
}
|
|
13419
13416
|
{% endfor %}
|
|
13420
13417
|
`;
|
|
@@ -13787,7 +13784,8 @@ var CaddyInstant = class {
|
|
|
13787
13784
|
restore = true,
|
|
13788
13785
|
base = "/",
|
|
13789
13786
|
showCaddyLog = false,
|
|
13790
|
-
https = false
|
|
13787
|
+
https = false,
|
|
13788
|
+
health_check = true
|
|
13791
13789
|
} = options || {};
|
|
13792
13790
|
this._source = source;
|
|
13793
13791
|
this._target = target;
|
|
@@ -13803,7 +13801,8 @@ var CaddyInstant = class {
|
|
|
13803
13801
|
port_suffix: https ? "" : ":80",
|
|
13804
13802
|
tls: https ? "tls internal" : "",
|
|
13805
13803
|
source,
|
|
13806
|
-
base
|
|
13804
|
+
base,
|
|
13805
|
+
health_check
|
|
13807
13806
|
}
|
|
13808
13807
|
];
|
|
13809
13808
|
writeCaddyConfig(proxies);
|
package/dist/esbuild.cjs
CHANGED
|
@@ -13440,7 +13440,8 @@ var ProxyType = type({
|
|
|
13440
13440
|
port_suffix: "string",
|
|
13441
13441
|
tls: "string",
|
|
13442
13442
|
source: "string",
|
|
13443
|
-
base: "string"
|
|
13443
|
+
base: "string",
|
|
13444
|
+
health_check: "boolean"
|
|
13444
13445
|
});
|
|
13445
13446
|
var CaddyContext = type({
|
|
13446
13447
|
caddy_root: "string",
|
|
@@ -13478,7 +13479,7 @@ var caddyTemplate = `{
|
|
|
13478
13479
|
{% for p in proxies %}
|
|
13479
13480
|
{{ p.target }}{{ p.port_suffix }} {
|
|
13480
13481
|
{{ p.tls }}
|
|
13481
|
-
reverse_proxy http://{{ p.source }} {
|
|
13482
|
+
reverse_proxy http://{{ p.source }} {% if p.health_check %} {
|
|
13482
13483
|
health_uri {{ p.base }}
|
|
13483
13484
|
health_interval 2s
|
|
13484
13485
|
health_timeout 5s
|
|
@@ -13486,11 +13487,6 @@ var caddyTemplate = `{
|
|
|
13486
13487
|
unhealthy_status 502 503 504 404
|
|
13487
13488
|
lb_try_duration 3s
|
|
13488
13489
|
lb_try_interval 300ms
|
|
13489
|
-
health_headers {
|
|
13490
|
-
Accept text/html
|
|
13491
|
-
Accept-Encoding gzip, deflate, br
|
|
13492
|
-
User-Agent Caddy-Health-Check
|
|
13493
|
-
}
|
|
13494
13490
|
|
|
13495
13491
|
@error status 502 503 504 404
|
|
13496
13492
|
handle_response @error {
|
|
@@ -13500,6 +13496,7 @@ var caddyTemplate = `{
|
|
|
13500
13496
|
}
|
|
13501
13497
|
}
|
|
13502
13498
|
}
|
|
13499
|
+
{% endif %}
|
|
13503
13500
|
}
|
|
13504
13501
|
{% endfor %}
|
|
13505
13502
|
`;
|
|
@@ -13872,7 +13869,8 @@ var CaddyInstant = class {
|
|
|
13872
13869
|
restore = true,
|
|
13873
13870
|
base = "/",
|
|
13874
13871
|
showCaddyLog = false,
|
|
13875
|
-
https = false
|
|
13872
|
+
https = false,
|
|
13873
|
+
health_check = true
|
|
13876
13874
|
} = options || {};
|
|
13877
13875
|
this._source = source;
|
|
13878
13876
|
this._target = target;
|
|
@@ -13888,7 +13886,8 @@ var CaddyInstant = class {
|
|
|
13888
13886
|
port_suffix: https ? "" : ":80",
|
|
13889
13887
|
tls: https ? "tls internal" : "",
|
|
13890
13888
|
source,
|
|
13891
|
-
base
|
|
13889
|
+
base,
|
|
13890
|
+
health_check
|
|
13892
13891
|
}
|
|
13893
13892
|
];
|
|
13894
13893
|
writeCaddyConfig(proxies);
|
package/dist/esbuild.js
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -13440,7 +13440,8 @@ var ProxyType = type({
|
|
|
13440
13440
|
port_suffix: "string",
|
|
13441
13441
|
tls: "string",
|
|
13442
13442
|
source: "string",
|
|
13443
|
-
base: "string"
|
|
13443
|
+
base: "string",
|
|
13444
|
+
health_check: "boolean"
|
|
13444
13445
|
});
|
|
13445
13446
|
var CaddyContext = type({
|
|
13446
13447
|
caddy_root: "string",
|
|
@@ -13478,7 +13479,7 @@ var caddyTemplate = `{
|
|
|
13478
13479
|
{% for p in proxies %}
|
|
13479
13480
|
{{ p.target }}{{ p.port_suffix }} {
|
|
13480
13481
|
{{ p.tls }}
|
|
13481
|
-
reverse_proxy http://{{ p.source }} {
|
|
13482
|
+
reverse_proxy http://{{ p.source }} {% if p.health_check %} {
|
|
13482
13483
|
health_uri {{ p.base }}
|
|
13483
13484
|
health_interval 2s
|
|
13484
13485
|
health_timeout 5s
|
|
@@ -13486,11 +13487,6 @@ var caddyTemplate = `{
|
|
|
13486
13487
|
unhealthy_status 502 503 504 404
|
|
13487
13488
|
lb_try_duration 3s
|
|
13488
13489
|
lb_try_interval 300ms
|
|
13489
|
-
health_headers {
|
|
13490
|
-
Accept text/html
|
|
13491
|
-
Accept-Encoding gzip, deflate, br
|
|
13492
|
-
User-Agent Caddy-Health-Check
|
|
13493
|
-
}
|
|
13494
13490
|
|
|
13495
13491
|
@error status 502 503 504 404
|
|
13496
13492
|
handle_response @error {
|
|
@@ -13500,6 +13496,7 @@ var caddyTemplate = `{
|
|
|
13500
13496
|
}
|
|
13501
13497
|
}
|
|
13502
13498
|
}
|
|
13499
|
+
{% endif %}
|
|
13503
13500
|
}
|
|
13504
13501
|
{% endfor %}
|
|
13505
13502
|
`;
|
|
@@ -13872,7 +13869,8 @@ var CaddyInstant = class {
|
|
|
13872
13869
|
restore = true,
|
|
13873
13870
|
base = "/",
|
|
13874
13871
|
showCaddyLog = false,
|
|
13875
|
-
https = false
|
|
13872
|
+
https = false,
|
|
13873
|
+
health_check = true
|
|
13876
13874
|
} = options || {};
|
|
13877
13875
|
this._source = source;
|
|
13878
13876
|
this._target = target;
|
|
@@ -13888,7 +13886,8 @@ var CaddyInstant = class {
|
|
|
13888
13886
|
port_suffix: https ? "" : ":80",
|
|
13889
13887
|
tls: https ? "tls internal" : "",
|
|
13890
13888
|
source,
|
|
13891
|
-
base
|
|
13889
|
+
base,
|
|
13890
|
+
health_check
|
|
13892
13891
|
}
|
|
13893
13892
|
];
|
|
13894
13893
|
writeCaddyConfig(proxies);
|
package/dist/index.js
CHANGED
package/dist/nuxt.cjs
CHANGED
|
@@ -13441,7 +13441,8 @@ var ProxyType = type({
|
|
|
13441
13441
|
port_suffix: "string",
|
|
13442
13442
|
tls: "string",
|
|
13443
13443
|
source: "string",
|
|
13444
|
-
base: "string"
|
|
13444
|
+
base: "string",
|
|
13445
|
+
health_check: "boolean"
|
|
13445
13446
|
});
|
|
13446
13447
|
var CaddyContext = type({
|
|
13447
13448
|
caddy_root: "string",
|
|
@@ -13479,7 +13480,7 @@ var caddyTemplate = `{
|
|
|
13479
13480
|
{% for p in proxies %}
|
|
13480
13481
|
{{ p.target }}{{ p.port_suffix }} {
|
|
13481
13482
|
{{ p.tls }}
|
|
13482
|
-
reverse_proxy http://{{ p.source }} {
|
|
13483
|
+
reverse_proxy http://{{ p.source }} {% if p.health_check %} {
|
|
13483
13484
|
health_uri {{ p.base }}
|
|
13484
13485
|
health_interval 2s
|
|
13485
13486
|
health_timeout 5s
|
|
@@ -13487,11 +13488,6 @@ var caddyTemplate = `{
|
|
|
13487
13488
|
unhealthy_status 502 503 504 404
|
|
13488
13489
|
lb_try_duration 3s
|
|
13489
13490
|
lb_try_interval 300ms
|
|
13490
|
-
health_headers {
|
|
13491
|
-
Accept text/html
|
|
13492
|
-
Accept-Encoding gzip, deflate, br
|
|
13493
|
-
User-Agent Caddy-Health-Check
|
|
13494
|
-
}
|
|
13495
13491
|
|
|
13496
13492
|
@error status 502 503 504 404
|
|
13497
13493
|
handle_response @error {
|
|
@@ -13501,6 +13497,7 @@ var caddyTemplate = `{
|
|
|
13501
13497
|
}
|
|
13502
13498
|
}
|
|
13503
13499
|
}
|
|
13500
|
+
{% endif %}
|
|
13504
13501
|
}
|
|
13505
13502
|
{% endfor %}
|
|
13506
13503
|
`;
|
|
@@ -13873,7 +13870,8 @@ var CaddyInstant = class {
|
|
|
13873
13870
|
restore = true,
|
|
13874
13871
|
base = "/",
|
|
13875
13872
|
showCaddyLog = false,
|
|
13876
|
-
https = false
|
|
13873
|
+
https = false,
|
|
13874
|
+
health_check = true
|
|
13877
13875
|
} = options || {};
|
|
13878
13876
|
this._source = source;
|
|
13879
13877
|
this._target = target;
|
|
@@ -13889,7 +13887,8 @@ var CaddyInstant = class {
|
|
|
13889
13887
|
port_suffix: https ? "" : ":80",
|
|
13890
13888
|
tls: https ? "tls internal" : "",
|
|
13891
13889
|
source,
|
|
13892
|
-
base
|
|
13890
|
+
base,
|
|
13891
|
+
health_check
|
|
13893
13892
|
}
|
|
13894
13893
|
];
|
|
13895
13894
|
writeCaddyConfig(proxies);
|
package/dist/nuxt.js
CHANGED
package/dist/rollup.cjs
CHANGED
|
@@ -13440,7 +13440,8 @@ var ProxyType = type({
|
|
|
13440
13440
|
port_suffix: "string",
|
|
13441
13441
|
tls: "string",
|
|
13442
13442
|
source: "string",
|
|
13443
|
-
base: "string"
|
|
13443
|
+
base: "string",
|
|
13444
|
+
health_check: "boolean"
|
|
13444
13445
|
});
|
|
13445
13446
|
var CaddyContext = type({
|
|
13446
13447
|
caddy_root: "string",
|
|
@@ -13478,7 +13479,7 @@ var caddyTemplate = `{
|
|
|
13478
13479
|
{% for p in proxies %}
|
|
13479
13480
|
{{ p.target }}{{ p.port_suffix }} {
|
|
13480
13481
|
{{ p.tls }}
|
|
13481
|
-
reverse_proxy http://{{ p.source }} {
|
|
13482
|
+
reverse_proxy http://{{ p.source }} {% if p.health_check %} {
|
|
13482
13483
|
health_uri {{ p.base }}
|
|
13483
13484
|
health_interval 2s
|
|
13484
13485
|
health_timeout 5s
|
|
@@ -13486,11 +13487,6 @@ var caddyTemplate = `{
|
|
|
13486
13487
|
unhealthy_status 502 503 504 404
|
|
13487
13488
|
lb_try_duration 3s
|
|
13488
13489
|
lb_try_interval 300ms
|
|
13489
|
-
health_headers {
|
|
13490
|
-
Accept text/html
|
|
13491
|
-
Accept-Encoding gzip, deflate, br
|
|
13492
|
-
User-Agent Caddy-Health-Check
|
|
13493
|
-
}
|
|
13494
13490
|
|
|
13495
13491
|
@error status 502 503 504 404
|
|
13496
13492
|
handle_response @error {
|
|
@@ -13500,6 +13496,7 @@ var caddyTemplate = `{
|
|
|
13500
13496
|
}
|
|
13501
13497
|
}
|
|
13502
13498
|
}
|
|
13499
|
+
{% endif %}
|
|
13503
13500
|
}
|
|
13504
13501
|
{% endfor %}
|
|
13505
13502
|
`;
|
|
@@ -13872,7 +13869,8 @@ var CaddyInstant = class {
|
|
|
13872
13869
|
restore = true,
|
|
13873
13870
|
base = "/",
|
|
13874
13871
|
showCaddyLog = false,
|
|
13875
|
-
https = false
|
|
13872
|
+
https = false,
|
|
13873
|
+
health_check = true
|
|
13876
13874
|
} = options || {};
|
|
13877
13875
|
this._source = source;
|
|
13878
13876
|
this._target = target;
|
|
@@ -13888,7 +13886,8 @@ var CaddyInstant = class {
|
|
|
13888
13886
|
port_suffix: https ? "" : ":80",
|
|
13889
13887
|
tls: https ? "tls internal" : "",
|
|
13890
13888
|
source,
|
|
13891
|
-
base
|
|
13889
|
+
base,
|
|
13890
|
+
health_check
|
|
13892
13891
|
}
|
|
13893
13892
|
];
|
|
13894
13893
|
writeCaddyConfig(proxies);
|
package/dist/rollup.js
CHANGED
package/dist/rspack.cjs
CHANGED
|
@@ -13439,7 +13439,8 @@ var ProxyType = type({
|
|
|
13439
13439
|
port_suffix: "string",
|
|
13440
13440
|
tls: "string",
|
|
13441
13441
|
source: "string",
|
|
13442
|
-
base: "string"
|
|
13442
|
+
base: "string",
|
|
13443
|
+
health_check: "boolean"
|
|
13443
13444
|
});
|
|
13444
13445
|
var CaddyContext = type({
|
|
13445
13446
|
caddy_root: "string",
|
|
@@ -13477,7 +13478,7 @@ var caddyTemplate = `{
|
|
|
13477
13478
|
{% for p in proxies %}
|
|
13478
13479
|
{{ p.target }}{{ p.port_suffix }} {
|
|
13479
13480
|
{{ p.tls }}
|
|
13480
|
-
reverse_proxy http://{{ p.source }} {
|
|
13481
|
+
reverse_proxy http://{{ p.source }} {% if p.health_check %} {
|
|
13481
13482
|
health_uri {{ p.base }}
|
|
13482
13483
|
health_interval 2s
|
|
13483
13484
|
health_timeout 5s
|
|
@@ -13485,11 +13486,6 @@ var caddyTemplate = `{
|
|
|
13485
13486
|
unhealthy_status 502 503 504 404
|
|
13486
13487
|
lb_try_duration 3s
|
|
13487
13488
|
lb_try_interval 300ms
|
|
13488
|
-
health_headers {
|
|
13489
|
-
Accept text/html
|
|
13490
|
-
Accept-Encoding gzip, deflate, br
|
|
13491
|
-
User-Agent Caddy-Health-Check
|
|
13492
|
-
}
|
|
13493
13489
|
|
|
13494
13490
|
@error status 502 503 504 404
|
|
13495
13491
|
handle_response @error {
|
|
@@ -13499,6 +13495,7 @@ var caddyTemplate = `{
|
|
|
13499
13495
|
}
|
|
13500
13496
|
}
|
|
13501
13497
|
}
|
|
13498
|
+
{% endif %}
|
|
13502
13499
|
}
|
|
13503
13500
|
{% endfor %}
|
|
13504
13501
|
`;
|
|
@@ -13871,7 +13868,8 @@ var CaddyInstant = class {
|
|
|
13871
13868
|
restore = true,
|
|
13872
13869
|
base = "/",
|
|
13873
13870
|
showCaddyLog = false,
|
|
13874
|
-
https = false
|
|
13871
|
+
https = false,
|
|
13872
|
+
health_check = true
|
|
13875
13873
|
} = options || {};
|
|
13876
13874
|
this._source = source;
|
|
13877
13875
|
this._target = target;
|
|
@@ -13887,7 +13885,8 @@ var CaddyInstant = class {
|
|
|
13887
13885
|
port_suffix: https ? "" : ":80",
|
|
13888
13886
|
tls: https ? "tls internal" : "",
|
|
13889
13887
|
source,
|
|
13890
|
-
base
|
|
13888
|
+
base,
|
|
13889
|
+
health_check
|
|
13891
13890
|
}
|
|
13892
13891
|
];
|
|
13893
13892
|
writeCaddyConfig(proxies);
|
package/dist/rspack.js
CHANGED
package/dist/types.d.cts
CHANGED
package/dist/types.d.ts
CHANGED
package/dist/vite.cjs
CHANGED
|
@@ -13440,7 +13440,8 @@ var ProxyType = type({
|
|
|
13440
13440
|
port_suffix: "string",
|
|
13441
13441
|
tls: "string",
|
|
13442
13442
|
source: "string",
|
|
13443
|
-
base: "string"
|
|
13443
|
+
base: "string",
|
|
13444
|
+
health_check: "boolean"
|
|
13444
13445
|
});
|
|
13445
13446
|
var CaddyContext = type({
|
|
13446
13447
|
caddy_root: "string",
|
|
@@ -13478,7 +13479,7 @@ var caddyTemplate = `{
|
|
|
13478
13479
|
{% for p in proxies %}
|
|
13479
13480
|
{{ p.target }}{{ p.port_suffix }} {
|
|
13480
13481
|
{{ p.tls }}
|
|
13481
|
-
reverse_proxy http://{{ p.source }} {
|
|
13482
|
+
reverse_proxy http://{{ p.source }} {% if p.health_check %} {
|
|
13482
13483
|
health_uri {{ p.base }}
|
|
13483
13484
|
health_interval 2s
|
|
13484
13485
|
health_timeout 5s
|
|
@@ -13486,11 +13487,6 @@ var caddyTemplate = `{
|
|
|
13486
13487
|
unhealthy_status 502 503 504 404
|
|
13487
13488
|
lb_try_duration 3s
|
|
13488
13489
|
lb_try_interval 300ms
|
|
13489
|
-
health_headers {
|
|
13490
|
-
Accept text/html
|
|
13491
|
-
Accept-Encoding gzip, deflate, br
|
|
13492
|
-
User-Agent Caddy-Health-Check
|
|
13493
|
-
}
|
|
13494
13490
|
|
|
13495
13491
|
@error status 502 503 504 404
|
|
13496
13492
|
handle_response @error {
|
|
@@ -13500,6 +13496,7 @@ var caddyTemplate = `{
|
|
|
13500
13496
|
}
|
|
13501
13497
|
}
|
|
13502
13498
|
}
|
|
13499
|
+
{% endif %}
|
|
13503
13500
|
}
|
|
13504
13501
|
{% endfor %}
|
|
13505
13502
|
`;
|
|
@@ -13872,7 +13869,8 @@ var CaddyInstant = class {
|
|
|
13872
13869
|
restore = true,
|
|
13873
13870
|
base = "/",
|
|
13874
13871
|
showCaddyLog = false,
|
|
13875
|
-
https = false
|
|
13872
|
+
https = false,
|
|
13873
|
+
health_check = true
|
|
13876
13874
|
} = options || {};
|
|
13877
13875
|
this._source = source;
|
|
13878
13876
|
this._target = target;
|
|
@@ -13888,7 +13886,8 @@ var CaddyInstant = class {
|
|
|
13888
13886
|
port_suffix: https ? "" : ":80",
|
|
13889
13887
|
tls: https ? "tls internal" : "",
|
|
13890
13888
|
source,
|
|
13891
|
-
base
|
|
13889
|
+
base,
|
|
13890
|
+
health_check
|
|
13892
13891
|
}
|
|
13893
13892
|
];
|
|
13894
13893
|
writeCaddyConfig(proxies);
|
package/dist/vite.js
CHANGED
package/dist/webpack.cjs
CHANGED
|
@@ -13440,7 +13440,8 @@ var ProxyType = type({
|
|
|
13440
13440
|
port_suffix: "string",
|
|
13441
13441
|
tls: "string",
|
|
13442
13442
|
source: "string",
|
|
13443
|
-
base: "string"
|
|
13443
|
+
base: "string",
|
|
13444
|
+
health_check: "boolean"
|
|
13444
13445
|
});
|
|
13445
13446
|
var CaddyContext = type({
|
|
13446
13447
|
caddy_root: "string",
|
|
@@ -13478,7 +13479,7 @@ var caddyTemplate = `{
|
|
|
13478
13479
|
{% for p in proxies %}
|
|
13479
13480
|
{{ p.target }}{{ p.port_suffix }} {
|
|
13480
13481
|
{{ p.tls }}
|
|
13481
|
-
reverse_proxy http://{{ p.source }} {
|
|
13482
|
+
reverse_proxy http://{{ p.source }} {% if p.health_check %} {
|
|
13482
13483
|
health_uri {{ p.base }}
|
|
13483
13484
|
health_interval 2s
|
|
13484
13485
|
health_timeout 5s
|
|
@@ -13486,11 +13487,6 @@ var caddyTemplate = `{
|
|
|
13486
13487
|
unhealthy_status 502 503 504 404
|
|
13487
13488
|
lb_try_duration 3s
|
|
13488
13489
|
lb_try_interval 300ms
|
|
13489
|
-
health_headers {
|
|
13490
|
-
Accept text/html
|
|
13491
|
-
Accept-Encoding gzip, deflate, br
|
|
13492
|
-
User-Agent Caddy-Health-Check
|
|
13493
|
-
}
|
|
13494
13490
|
|
|
13495
13491
|
@error status 502 503 504 404
|
|
13496
13492
|
handle_response @error {
|
|
@@ -13500,6 +13496,7 @@ var caddyTemplate = `{
|
|
|
13500
13496
|
}
|
|
13501
13497
|
}
|
|
13502
13498
|
}
|
|
13499
|
+
{% endif %}
|
|
13503
13500
|
}
|
|
13504
13501
|
{% endfor %}
|
|
13505
13502
|
`;
|
|
@@ -13872,7 +13869,8 @@ var CaddyInstant = class {
|
|
|
13872
13869
|
restore = true,
|
|
13873
13870
|
base = "/",
|
|
13874
13871
|
showCaddyLog = false,
|
|
13875
|
-
https = false
|
|
13872
|
+
https = false,
|
|
13873
|
+
health_check = true
|
|
13876
13874
|
} = options || {};
|
|
13877
13875
|
this._source = source;
|
|
13878
13876
|
this._target = target;
|
|
@@ -13888,7 +13886,8 @@ var CaddyInstant = class {
|
|
|
13888
13886
|
port_suffix: https ? "" : ":80",
|
|
13889
13887
|
tls: https ? "tls internal" : "",
|
|
13890
13888
|
source,
|
|
13891
|
-
base
|
|
13889
|
+
base,
|
|
13890
|
+
health_check
|
|
13892
13891
|
}
|
|
13893
13892
|
];
|
|
13894
13893
|
writeCaddyConfig(proxies);
|
package/dist/webpack.js
CHANGED
package/package.json
CHANGED
package/src/caddy/caddyfile.ts
CHANGED
|
@@ -7,6 +7,7 @@ export const ProxyType = type({
|
|
|
7
7
|
tls: 'string',
|
|
8
8
|
source: 'string',
|
|
9
9
|
base: 'string',
|
|
10
|
+
health_check: 'boolean',
|
|
10
11
|
})
|
|
11
12
|
|
|
12
13
|
const CaddyContext = type({
|
|
@@ -48,7 +49,7 @@ export const caddyTemplate = `{
|
|
|
48
49
|
{% for p in proxies %}
|
|
49
50
|
{{ p.target }}{{ p.port_suffix }} {
|
|
50
51
|
{{ p.tls }}
|
|
51
|
-
reverse_proxy http://{{ p.source }} {
|
|
52
|
+
reverse_proxy http://{{ p.source }} {% if p.health_check %} {
|
|
52
53
|
health_uri {{ p.base }}
|
|
53
54
|
health_interval 2s
|
|
54
55
|
health_timeout 5s
|
|
@@ -56,11 +57,6 @@ export const caddyTemplate = `{
|
|
|
56
57
|
unhealthy_status 502 503 504 404
|
|
57
58
|
lb_try_duration 3s
|
|
58
59
|
lb_try_interval 300ms
|
|
59
|
-
health_headers {
|
|
60
|
-
Accept text/html
|
|
61
|
-
Accept-Encoding gzip, deflate, br
|
|
62
|
-
User-Agent Caddy-Health-Check
|
|
63
|
-
}
|
|
64
60
|
|
|
65
61
|
@error status 502 503 504 404
|
|
66
62
|
handle_response @error {
|
|
@@ -70,6 +66,7 @@ export const caddyTemplate = `{
|
|
|
70
66
|
}
|
|
71
67
|
}
|
|
72
68
|
}
|
|
69
|
+
{% endif %}
|
|
73
70
|
}
|
|
74
71
|
{% endfor %}
|
|
75
72
|
`
|
package/src/caddy/index.ts
CHANGED
|
@@ -102,6 +102,7 @@ interface RunOptions {
|
|
|
102
102
|
base: string
|
|
103
103
|
showCaddyLog: boolean
|
|
104
104
|
https: boolean
|
|
105
|
+
health_check?: boolean
|
|
105
106
|
}
|
|
106
107
|
|
|
107
108
|
const { cleanUp, configJsonRef, writeCaddyConfig } = useCaddyConfig()
|
|
@@ -177,6 +178,7 @@ export class CaddyInstant {
|
|
|
177
178
|
base = '/',
|
|
178
179
|
showCaddyLog = false,
|
|
179
180
|
https = false,
|
|
181
|
+
health_check = true,
|
|
180
182
|
} = options || {}
|
|
181
183
|
|
|
182
184
|
this._source = source
|
|
@@ -198,6 +200,7 @@ export class CaddyInstant {
|
|
|
198
200
|
tls: https ? 'tls internal' : '',
|
|
199
201
|
source,
|
|
200
202
|
base,
|
|
203
|
+
health_check,
|
|
201
204
|
},
|
|
202
205
|
]
|
|
203
206
|
|