HAIMDALL must be reached over HTTPS. Its sign-in cookie is only sent over secure connections, so over plain HTTP nobody can sign in to the editor. HAIMDALL itself speaks plain HTTP on port 3000; put a reverse proxy that handles HTTPS in front of it — nginx, Apache, Caddy, Traefik, or your organisation's load balancer.
Who does what
Your network looks after everything in front of HAIMDALL: DNS for your help-site address, the HTTPS certificate, the reverse proxy, and any rules you want at the edge (such as an IP allow-list for the editor).
HAIMDALL needs to know its own public address, so that every link it writes points to the right place, and it can optionally give the editor an address of its own and send other names to the public address. These are set on Customer site › Domain, described below.
The first part of this article sets up the proxy; the second part covers the address settings.
What the proxy must do
Terminate HTTPS with a certificate for your help-site address, and redirect plain HTTP to HTTPS.
Forward requests to HAIMDALL on port 3000, passing the original
Hostheader (or settingX-Forwarded-Hostto it) andX-Forwarded-Proto: https. HAIMDALL uses them to know the address a visitor used (see Checking the proxy below).Append the visitor's address to the
X-Forwarded-Forheader. HAIMDALL uses it to slow down repeated wrong passwords per address.Allow request bodies of at least 50 MB, so imports (up to 50 MB) and uploads (up to 25 MB) aren't cut off.
Don't buffer streamed responses. AI answers and AI chat replies on the help site arrive word by word. nginx and Caddy handle this by themselves; IIS needs one setting (see its example).
Make the proxy the only way in
Visitors must reach HAIMDALL only through the proxy. If port 3000 is also reachable directly, visitors can bypass HTTPS, and can send their own X-Forwarded-For header to dodge sign-in protection. The supplied docker-compose.yml already publishes HAIMDALL's port on the local machine only — keep it that way:
ports:
- "127.0.0.1:${HAIMDALL_PORT:-3000}:3000"If your proxy runs on a different machine (a load balancer, or IIS on a Windows server), set HAIMDALL_BIND_ADDRESS in .env to this server's internal address, for example HAIMDALL_BIND_ADDRESS=10.0.0.5, run docker compose up -d, and use a firewall so that only the proxy can reach port 3000. The proxy then forwards to http://10.0.0.5:3000 instead of http://127.0.0.1:3000.
Tell HAIMDALL how many proxies there are
Set TRUST_PROXY_HOPS to the number of proxies between the internet and HAIMDALL: 1 (the default) for a single nginx, 2 if a load balancer sits in front of that. Each proxy adds the address it received the request from, so HAIMDALL takes the visitor's real address from that many entries from the end. A wrong value lets an attacker forge their address, or makes everyone appear to share one. Every setting is listed in Configuration Reference.
Example: nginx
server {
listen 80;
server_name help.example.com docs-admin.example.com;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
http2 on;
server_name help.example.com docs-admin.example.com;
# One certificate that covers both names (or a server block per name).
ssl_certificate /etc/ssl/certs/help.example.com.pem;
ssl_certificate_key /etc/ssl/private/help.example.com.key;
client_max_body_size 60m;
location / {
proxy_pass http://127.0.0.1:3000;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
}
}With this setup, leave TRUST_PROXY_HOPS at 1. docs-admin.example.com is only needed if you use a separate editor address; leave it out otherwise.
Example: Caddy
Caddy gets and renews HTTPS certificates by itself, redirects plain HTTP to HTTPS, passes on the Host header, sets X-Forwarded-For and X-Forwarded-Proto, streams AI answers and chat replies and has no upload limit, all without being told. A complete Caddyfile:
help.example.com, docs-admin.example.com {
reverse_proxy 127.0.0.1:3000
}Leave TRUST_PROXY_HOPS at 1. As with nginx, docs-admin.example.com is only needed for a separate editor address. For Caddy to get certificates automatically, both names must point at the server and ports 80 and 443 must be reachable from the internet; to use certificates you already have instead, add a line such as tls /etc/ssl/certs/help.example.com.pem /etc/ssl/private/help.example.com.key inside the block.
Example: IIS
IIS can be the reverse proxy with two free Microsoft modules, URL Rewrite and Application Request Routing (ARR). IIS runs on Windows and HAIMDALL on a Linux server, so this is usually the "different machine" case: set HAIMDALL_BIND_ADDRESS on the HAIMDALL server (see Make the proxy the only way in above). The examples use 10.0.0.5 for that server.
Install URL Rewrite and Application Request Routing on the IIS server.
Create a website with an HTTPS binding for each of your host names, using your certificate, and an HTTP binding on port 80 for the redirect.
In a command prompt run as administrator, switch on ARR's proxy and set it up for HAIMDALL:
%windir%\system32\inetsrv\appcmd.exe set config -section:system.webServer/proxy /enabled:"True" /preserveHostHeader:"True" /reverseRewriteHostInResponseHeaders:"False" /responseBufferLimit:"0" /commit:apphost
%windir%\system32\inetsrv\appcmd.exe set config -section:system.webServer/rewrite/allowedServerVariables /+"[name='HTTP_X_FORWARDED_PROTO']" /commit:apphostThese pass on the original Host header, leave HAIMDALL's own redirects alone (it sends visitors between the public and editor addresses itself), stop IIS buffering streamed AI answers and chat replies, and allow the site to set X-Forwarded-Proto. ARR adds X-Forwarded-For by itself (with a port number, which HAIMDALL ignores).
Put this
web.configin the website's folder:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="HTTPS only" stopProcessing="true">
<match url=".*" />
<conditions><add input="{HTTPS}" pattern="off" /></conditions>
<action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" appendQueryString="false" redirectType="Permanent" />
</rule>
<rule name="HAIMDALL" stopProcessing="true">
<match url=".*" />
<serverVariables>
<set name="HTTP_X_FORWARDED_PROTO" value="https" />
</serverVariables>
<action type="Rewrite" url="http://10.0.0.5:3000{UNENCODED_URL}" appendQueryString="false" />
</rule>
</rules>
</rewrite>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="62914560" />
</requestFiltering>
</security>
<httpErrors existingResponse="PassThrough" />
</system.webServer>
</configuration>{UNENCODED_URL} forwards each address exactly as the visitor sent it, including the ?query part. maxAllowedContentLength raises IIS's upload limit (about 28 MB by default) to 60 MB, and existingResponse="PassThrough" lets HAIMDALL's own error pages through instead of IIS's. Leave TRUST_PROXY_HOPS at 1.
Checking the proxy
Once the proxy is running, sign in through it and open Customer site › Domain. Under the public address the screen says You reached this page at …: that's the address HAIMDALL received. It should be exactly the address in your browser's address bar, for example https://help.example.com.
If it shows something like
http://127.0.0.1:3000orhttp://10.0.0.5:3000, the proxy isn't passing on theHostheader.If it shows
http://while you're usinghttps://, the proxy isn't sendingX-Forwarded-Proto.
Once the public address is set, System › Health also warns under Public address when it's reached on another host name (other than localhost or 127.0.0.1, which are treated as an admin working on the server itself) or over plain HTTP.
Next: your help site's addresses
Once the proxy works, set the address readers use on Customer site › Domain: see Your Help Site's Addresses. It also covers a separate editor address, sending other names to the public address, and search engines.
Security headers
HAIMDALL sends its own security headers: a content security policy, protection against being framed by other sites, and, in production, Strict-Transport-Security, which tells browsers to use HTTPS only for a year. You don't need to add these in the proxy. If you do add headers there, don't add a second Content-Security-Policy: browsers apply every policy they receive, so a second one can break the editor.