@edardev you’re already part of that thread.
In case of pwd, did you try changing FRAPPE_SITE_NAME_HEADER to $host?
FRAPPE_SITE_NAME_HEADER
$host