Skip to content

Instantly share code, notes, and snippets.

@thpham
Last active February 28, 2024 07:41
Show Gist options
  • Star 32 You must be signed in to star a gist
  • Fork 12 You must be signed in to fork a gist
  • Save thpham/114d20de8472b2cef966 to your computer and use it in GitHub Desktop.
Save thpham/114d20de8472b2cef966 to your computer and use it in GitHub Desktop.
test config haproxy for gRPC loadbalancing
global
tune.ssl.default-dh-param 1024
defaults
timeout connect 10000ms
timeout client 60000ms
timeout server 60000ms
frontend fe_http
mode http
bind *:8000
# Redirect to https
redirect scheme https code 301
frontend fe_https
mode tcp
bind *:8443 npn spdy/2 alpn h2,http/1.1
default_backend be_grpc
# gRPC servers running on port 8083-8084
backend be_grpc
mode tcp
balance roundrobin
server srv01 127.0.0.1:8083
server srv02 127.0.0.1:8084
@keshucscs
Copy link

Condition base mentinace

@oudamchea
Copy link

Question, Could you tell based on this haproxy config, how to access GRPC service? haproxyIP:PORT?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment