cloudflare / cloudflare/cloudflared

🐛unable to contact origin when origin_request is set at top level of config

Open
#894 0 comments 1 reaction 0 assignees View on GitHub
Priority: Normal Type: Bug
Dominant language
Go
Stars
15.6k
Forks
1.4k
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
Unable to contact origin when _origin_request_ is set at top level of config

**To Reproduce**
Steps to reproduce the behavior:

1. Configure the tunnel with _origin_request_ parameters to the top level

```
tunnel: ....
credentials-file: .....
originRequest: # Top-level configuration
connectTimeout: 30s
noTLSVerify: true
warp-routing:
enables: true

ingress:
...
```

**Expected behavior**
Ingress working....

**Environment and versions**
- Cloudflare Tunnel client 2023.2.1

**Logs and errors**
```
2023-02-12T11:21:30Z INF Warp-routing is enabled
2023-02-12T11:21:30Z INF Updated to new configuration config="{\"ingress\":[{\"service\":\"https://srv-infra.myorg.intra:8443\",\"hostname\":\"my-srv.my.org\"},{\"service\":\"http_status:404\"}],\"warp-routing\":{\"enabled\":true},\"originRequest\":{\"noTLSVerify\":true,\"originServerName\":\"\",\"caPool\":\"\",\"keepAliveConnections\":100,\"httpHostHeader\":\"\",\"disableChunkedEncoding\":false,\"proxyPort\":0,\"proxyType\":\"\",\"tlsTimeout\":10000000000,\"proxyAddress\":\"127.0.0.1\",\"connectTimeout\":30000000000,\"bastionMode\":false,\"tcpKeepAlive\":30000000000,\"noHappyEyeballs\":false,\"keepAliveTimeout\":90000000000}}" version=4
2023-02-12T11:21:59Z ERR error="Unable to reach the origin service. The service may be down or it may not be responding to traffic from cloudflared: dial tcp: lookup srv-infra.myorg.intra: i/o timeout" cfRay=7984f1a23cba153f-CDG ingressRule=0 originService=https://srv-infra.myorg.intra:8443
2023-02-12T11:21:59Z ERR Request failed error="Unable to reach the origin service. The service may be down or it may not be responding to traffic from cloudflared: dial tcp: lookup srv-infra.myorg.intra: i/o timeout" connIndex=0 dest=https://my-srv.my.org/ ip=198.41.200.53 type=http
```

**Additional context**

The problem can be circumvented by configuring the origin_request parameters at the ingress level.
```
12/02/2023 12:47:382023-02-12T11:47:38Z INF Warp-routing is enabled
12/02/2023 12:47:382023-02-12T11:47:38Z INF Updated to new configuration config="{\"ingress\":[{\"service\":\"https://srv-infra.myorg.intra:8443\",\"hostname\":\"my-srv.my.org\",\"originRequest\":{\"noTLSVerify\":true}},{\"service\":\"http_status:404\"}],\"warp-routing\":{\"enabled\":true}}" version=5
```

However this type of configuration is not possible with the terraform provider, see https://github.com/cloudflare/terraform-provider-cloudflare/issues/2234.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.