Caddy

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