Repository: caddyserver/caddy (language: go)

Issue:
network_proxy url not work
version: 2.10.0

Caddyfile
```
:8884
reverse_proxy 127.0.0.1:65535 {
	transport http {
		network_proxy url http://localhost:8080
	}
}
```

```
caddy  | {"level":"info","ts":1745218331.503794,"msg":"maxprocs: No GOMAXPROCS change to reset"}
caddy  | panic: reflect: call of reflect.Value.Type on zero Value
caddy  | 
caddy  | goroutine 1 [running]:
caddy  | reflect.Value.abiTypeSlow({0x0?, 0x0?, 0x0?})
caddy  |        reflect/value.go:2400 +0xee
caddy  | reflect.Value.typeSlow({0x0?, 0x0?, 0x8?})
caddy  |        reflect/value.go:2388 +0x1d
caddy  | reflect.Value.Type(...)
caddy  |        reflect/value.go:2383
caddy  | github.com/caddyserver/caddy/v2.Context.LoadModule({{0x1ed44f8, 0xc00049ced0}, 0xc00044cdb0, 0xc0002a95e0, {0xc00023f080, 0x3, 0x4}, {0x0, 0x0, 0x0}, ...}, ...)
caddy  |        github.com/caddyserver/caddy/v2@v2.10.0/context.go:181 +0xee
caddy  | github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy.(*HTTPTransport).NewTransport(0xc00021a0f0, {{0x1ed44f8, 0xc00049ced0}, 0xc00044cdb0, 0xc0002a95e0, {0xc00023f080, 0x3, 0x4}, {0x0, 0x0, ...}, ...})
caddy  |        github.com/caddyserver/caddy/v2@v2.10.0/modules/caddyhttp/reverseproxy/httptransport.go:356 +0x80f
caddy  | github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy.(*HTTPTransport).Provision(0xc00021a0f0, {{0x1ed44f8, 0xc00049ced0}, 0xc00044cdb0, 0xc0002a95e0, {0xc00023f080, 0x3, 0x4}, {0x0, 0x0, ...}, ...})
caddy  |        github.com/caddyserver/caddy/v2@v2.10.0/modules/caddyhttp/reverseproxy/httptransport.go:181 +0xc5
caddy  | github.com/caddyserver/caddy/v2.Context.LoadModuleByID({{0x1ed44f8, 0xc00049ced0}, 0xc00044cdb0, 0xc0002a95e0, {0xc00023f080, 0x3, 0x4}, {0x0, 0x0, 0x0}, ...}, ...)
caddy  |        github.com/caddyserver/caddy/v2@v2.10.0/context.go:410 +0x755
caddy  | github.com/caddyserver/caddy/v2.Context.loadModuleInline({{0x1ed44f8, 0xc00049ced0}, 0xc00044cdb0, 0xc0002a95e0, {0xc00020b7c0, 0x2, 0x2}, {0x0, 0x0, 0x0}, ...}, ...)
caddy  |        github.com/caddyserver/caddy/v2@v2.10.0/context.go:468 +0xf0
caddy  | github.com/caddyserver/caddy/v2.Context.LoadModule({{0x1ed44f8, 0xc00049ced0}, 0xc00044cdb0, 0xc0002a95e0, {0xc00020b7c0, 0x2, 0x2}, {0x0, 0x0, 0x0}, ...}, ...)
caddy  |        github.com/caddyserver/caddy/v2@v2.10.0/context.go:209 +0x426
caddy  | github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy.(*Handler).Provision(0xc0001a1680, {{0x1ed44f8, 0xc00049ced0}, 0xc00044cdb0, 0xc0002a95e0, {0xc00020b7c0, 0x2, 0x2}, {0x0, 0x0, ...}, ...})
caddy  |        github.com/caddyserver/caddy/v2@v2.10.0/modules/caddyhttp/reverseproxy/reverseproxy.go:241 +0x2b5
caddy  | github.com/caddyserver/caddy/v2.Context.LoadModuleByID({{0x1ed44f8, 0xc00049ced0}, 0xc00044cdb0, 0xc0002a95e0, {0xc00020b7c0, 0x2, 0x2}, {0x0, 0x0, 0x0}, ...}, ...)
caddy  |        github.com/caddyserver/caddy/v2@v2.10.0/context.go:410 +0x755
caddy  | github.com/caddyserver/caddy/v2.Context.loadModuleInline({{0x1ed44f8, 0xc00049ced0}, 0xc00044cdb0, 0xc0002a95e0, {0xc00047b020, 0x1, 0x1}, {0x0, 0x0, 0x0}, ...}, ...)
caddy  |        github.com/caddyserver/caddy/v2@v2.10.0/context.go:468 +0xf0
caddy  | github.com/caddyserver/caddy/v2.Context.LoadModule({{0x1ed44f8, 0xc00049ced0}, 0xc00044cdb0, 0xc0002a95e0, {0xc00047b020, 0x1, 0x1}, {0x0, 0x0, 0x0}, ...}, ...)
caddy  |        github.com/caddyserver/caddy/v2@v2.10.0/context.go:222 +0x6e6
caddy  | github.com/caddyserver/caddy/v2/modules/caddyhttp.(*Route).ProvisionHandlers(0xc0007d1cb0, {{0x1ed44f8, 0xc00049ced0}, 0xc00044cdb0, 0xc0002a95e0, {0xc00047b020, 0x1, 0x1}, {0x0, 0x0, ...}, ...}, ...)
caddy  |        github.com/caddyserver/caddy/v2@v2.10.0/modules/caddyhttp/routes.go:154 +0x6e
caddy  | github.com/caddyserver/caddy/v2/modules/caddyhttp.RouteList.ProvisionHandlers({0xc0007d1cb0, 0x1, 0xc00021eb90?}, {{0x1ed44f8, 0xc00049ced0}, 0xc00044cdb0, 0xc0002a95e0, {0xc00047b020, 0x1, 0x1}, ...}, ...)
caddy  |        github.com/caddyserver/caddy/v2@v2.10.0/modules/caddyhttp/routes.go:212 +0xa6
caddy  | github.com/caddyserver/caddy/v2/modules/caddyhttp.(*App).Provision(0xc0005ae6c0, {{0x1ed44f8, 0xc00049ced0}, 0xc00044cdb0, 0xc0002a95e0, {0xc00047b020, 0x1, 0x1}, {0x0, 0x0, ...}, ...})
caddy  |        github.com/caddyserver/caddy/v2@v2.10.0/modules/caddyhttp/app.go:367 +0xf09
caddy  | github.com/caddyserver/caddy/v2.Context.LoadModuleByID({{0x1ed4530, 0xc0003f49b0}, 0xc00044cdb0, 0xc0002a95e0, {0xc00047b020, 0x1, 0x1}, {0x0, 0x0, 0x0}, ...}, ...)
caddy  |        github.com/caddyserver/caddy/v2@v2.10.0/context.go:410 +0x755
caddy  | github.com/caddyserver/caddy/v2.Context.App({{0x1ed4530, 0xc0003f49b0}, 0xc00044cdb0, 0xc0002a95e0, {0x0, 0x0, 0x0}, {0x0, 0x0, 0x0}, ...}, ...)
caddy  |        github.com/caddyserver/caddy/v2@v2.10.0/context.go:494 +0xee
caddy  | github.com/caddyserver/caddy/v2.provisionContext.func3(...)
caddy  |        github.com/caddyserver/caddy/v2@v2.10.0/caddy.go:550
caddy  | github.com/caddyserver/caddy/v2.provisionContext(0x0?, 0x1)
caddy  |        github.com/caddyserver/caddy/v2@v2.10.0/caddy.go:555 +0x5b8
caddy  | github.com/caddyserver/caddy/v2.run(0xc00054b638?, 0x1)
caddy  |        github.com/caddyserver/caddy/v2@v2.10.0/caddy.go:401 +0x78
caddy  | github.com/caddyserver/caddy/v2.unsyncedDecodeAndRun({0xc0004e6700, 0xf5, 0x100}, 0x1)
caddy  |        github.com/caddyserver/caddy/v2@v2.10.0/caddy.go:344 +0x145
caddy  | github.com/caddyserver/caddy/v2.changeConfig({0x1a023c5, 0x4}, {0x1a0926b, 0x7}, {0xc0004e6600, 0xf5, 0x100}, {0x0, 0x0}, 0x1)
caddy  |        github.com/caddyserver/caddy/v2@v2.10.0/caddy.go:235 +0x6b9
caddy  | github.com/caddyserver/caddy/v2.Load({0xc0004e6600, 0xf5, 0x100}, 0x1)
caddy  |        github.com/caddyserver/caddy/v2@v2.10.0/caddy.go:134 +0x22d
caddy  | github.com/caddyserver/caddy/v2/cmd.cmdRun({0x0?})
caddy  |        github.com/caddyserver/caddy/v2@v2.10.0/cmd/commandfuncs.go:239 +0x811
caddy  | github.com/caddyserver/caddy/v2/cmd.init.1.func2.WrapCommandFuncForCobra.1(0xc000556008, {0x1a02421?, 0x4?, 0x1a023f5?})
caddy  |        github.com/caddyserver/caddy/v2@v2.10.0/cmd/cobra.go:141 +0x2f
caddy  | github.com/spf13/cobra.(*Command).execute(0xc000556008, {0xc000232f80, 0x4, 0x4})
caddy  |        github.com/spf13/cobra@v1.9.1/command.go:1015 +0xa94
caddy  | github.com/spf13/cobra.(*Command).ExecuteC(0xc00017f808)
caddy  |        github.com/spf13/cobra@v1.9.1/command.go:1148 +0x40c
caddy  | github.com/spf13/cobra.(*Command).Execute(...)
caddy  |        github.com/spf13/cobra@v1.9.1/command.go:1071
caddy  | github.com/caddyserver/caddy/v2/cmd.Main()
caddy  |        github.com/caddyserver/caddy/v2@v2.10.0/cmd/main.go:72 +0x65
caddy  | main.main()
caddy  |        caddy/main.go:39 +0xf
```


Discussion / hints:

Fix patch:
diff --git a/modules/caddyhttp/reverseproxy/httptransport.go b/modules/caddyhttp/reverseproxy/httptransport.go
index 925732a8d9a..fec531434e8 100644
--- a/modules/caddyhttp/reverseproxy/httptransport.go
+++ b/modules/caddyhttp/reverseproxy/httptransport.go
@@ -353,7 +353,7 @@ func (h *HTTPTransport) NewTransport(caddyCtx caddy.Context) (*http.Transport, e
 		h.NetworkProxyRaw = caddyconfig.JSONModuleObject(u, "from", "url", nil)
 	}
 	if len(h.NetworkProxyRaw) != 0 {
-		proxyMod, err := caddyCtx.LoadModule(h, "ForwardProxyRaw")
+		proxyMod, err := caddyCtx.LoadModule(h, "NetworkProxyRaw")
 		if err != nil {
 			return nil, fmt.Errorf("failed to load network_proxy module: %v", err)
 		}
diff --git a/modules/caddytls/acmeissuer.go b/modules/caddytls/acmeissuer.go
index bf2ebeacca3..4830570bfb4 100644
--- a/modules/caddytls/acmeissuer.go
+++ b/modules/caddytls/acmeissuer.go
@@ -220,7 +220,7 @@ func (iss *ACMEIssuer) makeIssuerTemplate(ctx caddy.Context) (certmagic.ACMEIssu
 	}
 
 	if len(iss.NetworkProxyRaw) != 0 {
-		proxyMod, err := ctx.LoadModule(iss, "ForwardProxyRaw")
+		proxyMod, err := ctx.LoadModule(iss, "NetworkProxyRaw")
 		if err != nil {
 			return template, fmt.Errorf("failed to load network_proxy module: %v", err)
 		}


Test patch: