Error in config.yml

Hi all,
I first tried to follow the recommendation here: https://bobcares.com/blog/cloudflare-tunnel-proxmox/ which led me to having this error:

error parsing YAML in config file at /root/.cloudflared/config.yml: yaml: line 9: did not find expected key

After doing some further research I found this: https://community.cloudflare.com/t/error-parsing-yaml-in-config-file-at-root-cloudflared-config-yml-yaml-line-8-did-not-find-expected-key/468239 going off it I made my config.yml to have the following:

tunnel: UUID
credentials-file: /root/.cloudflared/UUID.json

ingress:
- hostname: proxmox.mysite.url
   service: https://localhost:8006
   originRequest:
     disableChunkedEncoding: true
     connectTimeout: 30s
     noTLSVerify: true
 - service: http_status:404

I now get the following:

error parsing YAML in config file at /root/.cloudflared/config.yml: yaml: line 6: mapping values are not allowed in this context

Any suggestions?

Your indentation is wrong, you can see the difference between yours and the post you referenced. Missing indent after ingress block on first hostname, and then you have it back on your second 404 service.
Yaml is fun.
Try this:

tunnel: UUID
credentials-file: /root/.cloudflared/UUID.json

ingress:
  - hostname: proxmox.mysite.url
    service: https://localhost:8006
    originRequest:
      disableChunkedEncoding: true
      connectTimeout: 30s
      noTLSVerify: true
  - service: http_status:404

Validates fine for me with cloudflared. You can use the command cloudflared tunnel ingress validate to test.
Sometimes the forums mangle it as well.

ps. Consider using Zero Trust Managed Tunnels sometime, you never have to deal with yaml again and it’s more guided, creates the required DNS Records for you, overall easier to use, etc. Here’s a good guide on getting started:

It also can convert “old” config.yml style tunnels to dashboard tunnels for you in the dashboard.

1 Like