HAProxy

Flow of an inbound network request
%%{init: {'theme': 'neutral'}}%%
graph LR
	A[Your Browser] -->|HTTPS 443/tcp| Z
	Z["Proxy"] -->|HTTP 80/tcp| C
	C["Single HTTP frontend"]
	H["Prometheus"]
	B["gRPC API"]

	subgraph "OliveTin service"
	C -->|/api/| D[REST API] --> B
	C -->|/| E[webui]
    C -->|/metrics/| H
	end

This is a straightforward example of how to setup a DNS name based HAProxy setup for OliveTin.

/etc/haproxy/haproxy.conf
frontend cleartext_frontend
    bind 0.0.0.0:80

    option httplog

    use_backend be_olivetin_webs if { hdr(Host) -i olivetin.example.com && path_beg /websocket }
    use_backend be_olivetin_http if { hdr(Host) -i olivetin.example.com }

backend be_olivetin_http
    server olivetinServer 127.0.0.1:1337 check

backend be_olivetin_webs
    timeout tunnel 1h
    option http-server-close
    server olivetinServer 127.0.0.1:1337