pingora icon indicating copy to clipboard operation
pingora copied to clipboard

Adding Host headers via arguments and route to upstream according to headers.

Open muhammadn opened this issue 11 months ago • 1 comments

I am writing a load balancer that configures dynamically configure upstream and host headers.

Looking at here: https://github.com/cloudflare/pingora/issues/134 which is similar but is based on url paths.

If for example i want to support multiple Host http header, i want to route to specific upstream servers for each requests with the Host header.

I was hoping some documentation that helps me achieve that. My source code is at https://github.com/muhammadn/projectlb

muhammadn avatar Mar 23 '24 21:03 muhammadn

I use pingora for my reverse proxy, you can look at the source code of upstream_peer: https://github.com/vicanso/pingap/blob/main/src/proxy/server.rs#L336

graph TD;
    start("New Request")-->server;

    server -- "host:HostA, Path:/api/*" --> locationA

    server -- "Path:/rest/*"--> locationB

    locationA -- "10.0.0.1:8001" --> upstreamA1

    locationA -- "10.0.0.2:8001" --> upstreamA2

    locationB -- "10.0.0.1:8002" --> upstreamB1

    locationB -- "10.0.0.2:8002" --> upstreamB2

vicanso avatar Mar 24 '24 13:03 vicanso

This question has been stale for a week. It will be closed in an additional day if not updated.

github-actions[bot] avatar Apr 02 '24 01:04 github-actions[bot]

This issue has been closed because it has been stalled with no activity.

github-actions[bot] avatar Apr 04 '24 01:04 github-actions[bot]