2.8 HAProxy Configuration

To configure HAProxy, follow these steps:
  1. Navigate to /etc/haproxy directory and execute following command in the terminal.
    cd /etc/haproxy
  2. Open the haproxy.cfg file and execute following command in the terminal.
    vi haproxy.cfg
  3. Add the following frontend and backend blocks in the haproxy.cfg file.
    # HAPROXY CONFIGURATION STARTS
    Frontend configurations

    Note:

    For example, use Compliance_Studio_Gateway_Port as 7071.
    frontend compliance_studio
    bind *:<Compliance_Studio_Gateway_Port>
    mode http
    bind *:443 ssl crt /etc/ssl/certs/haproxy.pem
    use_backend fcc_ui if { path /fcc } || { path_beg /fcc/ }
    http-request set-header X-Forwarded-For %[src]
    reqadd X-Forwarded-Proto:\ https
    option http-server-close
    default_backend compliance_studio
    
    frontend mmg
    bind *:7002 ssl crt /etc/ssl/certs/haproxy.pem mode http
    default_backend mmg
    
    frontend data_studio
    bind *:7008 ssl crt /etc/ssl/certs/haproxy.pem mode http
    default_backend data_studio
    
    frontend dp_ui
    bind *:7063 ssl crt /etc/ssl/certs/haproxy.pem mode http
    default_backend dp_ui
    
    frontend graph_service
    bind *:7059 ssl crt /etc/ssl/certs/haproxy.pem mode http
    default_backend graph_service
    
    frontend pipeline_service
    bind *:18005 ssl crt /etc/ssl/certs/haproxy.pem
    mode http
    default_backend pipeline_service
    
    frontend datapipeline_service
    bind *:18006 ssl crt /etc/ssl/certs/haproxy.pem
    mode http
    default_backend datapipeline_service
    
    frontend pgx_server
    bind *:7007
    mode http
    default_backend pgx_server
    Backend configurations

    Note:

    For example, use Compliance_Studio_Gateway_Port as 7071.
    backend compliance_studio
    mode http
    balance roundrobin
    cookie JSESSIONID prefix nocache
    server cs_server_1
    <server_1_hostname>:<Compliance_Studio_Gateway_Port>/cs/home check ssl verify none
    server cs_server_2
    <server_2_hostname>:<Compliance_Studio_Gateway_Port>/cs/home check ssl verify none
    
    backend mmg
    mode http
    balance roundrobin
    cookie JSESSIONID prefix nocache
    server mmg_1 <server_1_hostname>:7002 check ssl verify none
    server mmg_2 <server_2_hostname>:7002 check ssl verify none
    
    backend data_studio
    mode http
    balance roundrobin
    cookie JSESSIONID prefix nocache
    server data_studio_1 <server_1_hostname>:7008/cs check ssl verify
    none
    server data_studio_2 <server_2_hostname>:7008/cs check ssl verify
    none
    
    backend dp_ui
    mode http
    balance roundrobin
    cookie JSESSIONID prefix nocache
    server dp_ui_1 <server_1_hostname>:7063/pipelineserviceui check ssl
    verify none
    server dp_ui_2 <server_2_hostname>:7063/pipelineserviceui check ssl
    verify none
    
    backend fcc_ui
    mode http
    balance roundrobin
    cookie JSESSIONID prefix nocache
    server fcc_ui_1 <server_1_hostname>:7061/fcc check ssl verify none
    server fcc_ui_2 <server_2_hostname>: 7061/fcc check ssl verify none
    
    backend graph_service
    mode http
    balance roundrobin
    cookie JSESSIONID prefix nocache
    server graph_service_1 <server_1_hostname>:7059 check ssl verify none
    server graph_service_2 <server_2_hostname>:7059 check ssl verify none
    
    backend pipeline_service
    mode http
    balance roundrobin
    cookie JSESSIONID prefix nocache
    server pipeline_service_1 <server_1_hostname>:18005 check ssl verify
    none
    server pipeline_service_2 <server_2_hostname>:18005 check ssl verify
    none
    
    backend datapipeline_service
    mode http
    balance roundrobin
    cookie JSESSIONID prefix nocache
    server datapipeline_service_1 <server_1_hostname>:18006 check ssl
    verify none
    server datapipeline_service_2 <server_2_hostname>:18006 check ssl
    verify none
    
    backend pgx_server
    mode http
    cookie PGX_INSTANCE_STICKY_COOKIE insert indirect nocache
    server pgx_server_1 <server_1_hostname>:7007 check
    server pgx_server_2 <server_1_hostname>:7007 check cookie
    pgx_server_2
    option httpchk GET /isReady http-check expect string true
    # HAPROXY CONFIGURATION ENDS