Score:0

Match traffic based on port with Cloudflare Tunnel

br flag

I am currently setting up Cloudflare tunnels for testing. I have a working tunnel setup on my origin server that is running nginx as a reverse proxy with a number of hostnames each having 2 distinct services running on ports 443 and 2096 respectively. I.e:

a.example.com:443
a.example.com:2096
b.example.com:443
b.example.com:2096 
…

Matching traffic based on hostnames works fine but I am now having trouble properly differentiating traffic based on those 2 ports. I.e. when visiting https://a.example.com:2096 I get redirected to the service running on port 443 as well.

The ingress rules in my cloudflared config.yaml file look like this right now:

ingress:

  - hostname: a.example.com
    service: https://localhost:443
    originRequest:
      originServerName: a.example.com
  - hostname: a.example.com
    service: https://localhost:2096
    originRequest:
      originServerName: a.example.com
  - service: http_status:404

I am omitting the nginx configuration as it is working fine right now when just pointing an A record to the IP of the origin server and proxying traffic through cloudflare.

Can anyone hint me in the right direction to get this working properly? TIA!

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.