@sarge , I am running the following config:
Configuration file refers to port 3443:
However, I get the following error:
{"level":"error","ts":1588645443.4411454,"logger":"admin.api","msg":"request error","error":"loading config: loading new config: http app module: start: tcp: listening on :80: listen tcp :80: bind: permission denied","status_code":400}
{"level":"info","ts":1588645443.4412885,"logger":"admin","msg":"stopped previous server"}
2020/05/04 22:24:03 [INFO][cache:0xc0001fc9b0] Started certificate maintenance routine
2020/05/04 22:24:03 caddytest: config load time took 10.342526ms
TestPlugin: caddytest.go:96: failed to load config: {"error":"loading config: loading new config: http app module: start: tcp: listening on :80: listen tcp :80: bind: permission denied"}
2020/05/04 22:24:03 caddytest: redirecting the dialer from 127.0.0.1:3443 to 127.0.0.1:3443
How to fix the error in the test configuration?
I'll just close this as a discussion (nothing actionable here for the Caddy project at this time, correct me if I'm wrong)
I'll just close this as a discussion (nothing actionable here for the Caddy project at this time, correct me if I'm wrong)
@francislavoie , there is something actionable here ... The config provided to the test instance is not being respected by the test. Previously, it worked.
I think it is the automatic http -> https redirection kicking in.
https://github.com/caddyserver/caddy/blob/master/caddytest/integration/sni_test.go#L15-L17
It automatically binds to port 80.
If you set the http_port to something higher like 9080 this should avoid the binding issues
I think it is the automatic http -> https redirection kicking in.
@sarge , thank you for the pointer! 馃憤 Adding non-privileged port in http_port worked!
--- a/assets/conf/Caddyfile.json
+++ b/assets/conf/Caddyfile.json
@@ -8,6 +8,7 @@
},
"apps": {
"http": {
+ "http_port": 3080,
"https_port": 3443,
"servers": {
"srv0": {
Most helpful comment
I think it is the automatic http -> https redirection kicking in.
https://github.com/caddyserver/caddy/blob/master/caddytest/integration/sni_test.go#L15-L17
It automatically binds to port 80.
If you set the http_port to something higher like 9080 this should avoid the binding issues