global		
	    # to have these messages end up in /var/log/haproxy.log you will	
	    # need to:	
	    #	
	    # 1) configure syslog to accept network log events.  This is done	
	    #    by adding the '-r' option to the SYSLOGD_OPTIONS in	
	    #    /etc/sysconfig/syslog	
	    #	
	    # 2) configure local2 events to go to the /var/log/haproxy.log	
	    #   file. A line like the following can be added to	
	    #   /etc/sysconfig/syslog	
	    #	
	    #    local2.*                       /var/log/haproxy.log	
	    #	
	    log         127.0.0.1 local0	

	    chroot      /var/lib/haproxy	
	    pidfile     /var/run/haproxy.pid	
	    maxconn     2048	
	    user        haproxy	
	    group       haproxy	
	    tune.ssl.default-dh-param 2048	
	    daemon	

	    # turn on stats unix socket	
	    stats socket /var/lib/haproxy/stats	

	#---------------------------------------------------------------------	
	# common defaults that all the 'listen' and 'backend' sections will	
	# use if not designated in their block	
	#---------------------------------------------------------------------	
	defaults	
	    mode                    http	
	    option forwardfor	
	    option http-server-close	
	    log                     global	
	    option                  httplog	
	    option                  dontlognull	
	    option                  redispatch	
	    retries                 3	
	    timeout http-request    10s	
	    timeout queue           1m	
	    timeout connect         10s	
	    timeout client          1m	
	    timeout server          1m	
	    monitor-uri /index.html	
	    timeout http-keep-alive 10s	
	    timeout check           10s	
	    stats enable	
	    stats uri /stats	
	    stats realm Haproxy\ Statistics	
	    stats auth user:user	

	
	
	#---------------------------------------------------------------------	
	# Resolvers section	
	#---------------------------------------------------------------------	
	resolvers awsvpc	
	    nameserver vpc 172.31.0.2:53	
	    resolve_retries       30	
	    timeout retry         1s	
	    hold valid           10s	

	
	#---------------------------------------------------------------------	
	# main frontend which proxys to the backends	
	#---------------------------------------------------------------------	
	frontend haproxy_in	
	    #bind *:81	
	    bind *:443 ssl crt /etc/ssl/private/domain.pem	
	    reqadd X-Forwarded-Proto:\ https	
	    acl url_api path_beg /api	
	    use_backend api-backend if url_api	

	    acl url_login path_beg /login	
	    use_backend login-backend if url_login	

	    acl url_mobile_login path_beg /mobile_login	
	    use_backend mobile_login-backend if url_mobile_login	

	#---------------------------------------------------------------------	
	# round robin balancing between the various backends	
	#---------------------------------------------------------------------	
	backend api-backend	
	    reqrep ^([^\ :]*)\ /api/(.*) \1\ /\2	
	    server foo-a fs-sim-alb-external-XXXXXXXXXX.com:39996 resolvers awsvpc	

	backend login-backend	
	    reqrep ^([^\ :]*)\ /login/(.*) \1\ /\2	
	    server foo-a fs-sim-alb-external-XXXXXXXXXX.com:39997 resolvers awsvpc	

	backend mobile_login-backend	
	    reqrep ^([^\ :]*)\ /mobile_login/(.*) \1\ /\2	
	    server foo-a fs-sim-alb-external-XXXXXXXXX.com:39991 resolvers awsvpc