Drone adding wrong webhook url to GItea

I run Drone (and agent) and Gitea under docker containers which are reverse proxy’d by NGINX such that I can access https://git.mydomain.com and https://drone.mydomain.com. My Drone environment looks like this:

    environment:
      - DRONE_OPEN=true
      - DRONE_HOST=https://drone.mydomain.com
      - DRONE_GITEA=true
      - DRONE_GITEA_URL=https://git.mydomain.com
      - DRONE_SECRET=mysecret

However, Drone adds the webhook to my Gitea repo as:
http://localhost:8001/hook?access_token=someaccesstoken
Anyone know why this happens / how I could fix it?
Thanks!

You need to set X-Forwarded-For and X-Forwarded-Proto when running Drone behind a reverse proxy so that Drone can ascertain its address form the incoming HTTP request. We provide sample nginx, apache and caddy configurations that you can reference in our docs: http://docs.drone.io/setup-with-nginx/

See also: Payload URL generation of webhooks ignores DRONE_HOST