0

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!

MoWo
  • 443
  • 1
  • 10

0 Answers0