Skip to content

HEAL Companion Mobile App Backend Setup

Prepare certificates, DNS, and HAProxy routing so the mobile app can reach HEAL.

2 min read Updated SS

This guide is for administrators. It describes how to prepare the backend so the HEAL Mobile App can reach your environment: obtaining a domain certificate, publishing a DNS record in Amazon Route 53, verifying connectivity, and routing traffic through HAProxy.

Complete these steps before end users install and configure the app.

Prerequisites#

  • Access to your organization's AWS account with permission to manage Route 53.
  • The HEAL UI, mobile backend service, and Keycloak single sign-on are up and running.
  • Shell access to the host running HAProxy.

1. Prepare the domain certificate#

  1. Obtain a domain certificate for your HEAL mobile endpoint.
  2. Generate a PEM file from the domain certificate. You will reference this PEM file in the HAProxy configuration.

2. Publish a DNS record in Route 53#

  1. Sign in to the AWS console and open the Route 53 service, either from Recently visited or by searching for route 53.

    AWS Console Home with Route 53 highlighted under Recently visited

  2. Under DNS management, open Hosted zones.

    Route 53 dashboard showing DNS management and the Hosted zones option

  3. Tap Create hosted zone and complete the wizard for your domain.

    Hosted zones list with the Create hosted zone button highlighted

  4. In the hosted zone, click Create record.

    Hosted zone records view with the Create record button highlighted

  5. Enter the record details:

    • Record name — the name for your endpoint.
    • Record type — A for an IPv4 address, or AAAA for an IPv6 address.
    • Value — the IP address of the host where HAProxy is running.

    Quick create record form with Record name, Record type, and Value fields

3. Verify frontend connectivity#

Confirm that the frontend service is reachable at the IP and port you published. Use telnet with the frontend IP and port:

telnet <frontend-ip> <frontend-port>

Example:

[root@build-host ~]# telnet 198.51.100.13 199

If the service is running, the connection is established:

Trying 198.51.100.13...
Connected to 198.51.100.13.
Escape character is '^]'.

If the service is not running, the connection fails:

Trying 198.51.100.13...
telnet: connect to address 198.51.100.13: No route to host

4. Configure HAProxy routing#

  1. Update haproxy.cfg with the frontend configuration. For a single secured connection:

    bind :443 ssl crt /etc/ssl/haproxy.pem alpn h2,http/1.1
    acl url_front_graphiql path_beg -i /graphiql
    acl url_front_graphql path_beg -i /graphql
    acl url_kc_oauth path_beg -i /auth
    use_backend graphql_backend if url_front_graphiql || url_front_graphql
    

    For two frontends:

    bind :443 ssl crt /etc/ssl/haproxy.pem alpn h2,http/1.1
    acl url_front_graphiql path_beg -i /graphiql
    acl url_front_graphql path_beg -i /graphql
    acl url_kc_oauth path_beg -i /auth
    acl port_443 dst_port 443
    use_backend graphql_backend if url_front_graphiql || url_front_graphql
    use_backend oauth_backend if url_kc_oauth port_443
    
  2. Add the PEM file location to the HAProxy nomad file. For a secured connection, add the PEM path under the volumes section, for example /etc/ssl/haproxy.pem:

    volumes = [
      "/opt/appnomic/Appsone_Service/health_chk_script/haproxy.sh:/tmp/haproxy.sh",
      "/opt/appnomic/Appsone_Service/conf/HAPROXY:/usr/local/etc/haproxy",
      "/opt/appnomic/Appsone_Service/data/cert/haproxy.pem:/etc/ssl/haproxy.pem",
      "/opt/appnomic/centeralized_logs/haproxy:/tmp/logs",
      "/etc/localtime:/etc/localtime",
      "/etc/hosts:/etc/hosts"
    ]
    
  3. Restart HAProxy to apply the changes.

Once the backend is configured, users can point the app at https://<your-heal-mobile-endpoint> and sign in.

Next

Using the HEAL Mobile App — Verify the HEAL Agent Deployment — Access the HEAL UI