Caddy

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

Caddy seems to work without any special configuration, so a simple Caddyfile works like this;

Caddyfile
http://olivetin.example.com {
        reverse_proxy * http://localhost:1337
}

Custom paths

Caddyfile
....
	handle {$GLOBAL_PORTAL_PATH}/olivetin* {
			redir {$GLOBAL_PORTAL_PATH}/olivetin {$GLOBAL_PORTAL_PATH}/olivetin/
			uri strip_prefix {$GLOBAL_PORTAL_PATH}/olivetin
			basicauth {
					{$GLOBAL_USER} HASH
			}
			reverse_proxy * localhost:1337
	}
....

Note, because you are changing the default path (from / to /OliveTin/), you will need to tell the OliveTin webUI where to find the API.

You need to also set externalRestAddress in your config.yaml like this;

OliveTin config.yaml
externalRestAddress: http://myserver/OliveTin