Skip to content

Commit c31f46e

Browse files
committed
docs(self-hosting): clarify docker domain build-time requirements
1 parent 9efd0e6 commit c31f46e

1 file changed

Lines changed: 19 additions & 1 deletion

File tree

apps/docs/content/docker.mdx

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ These variables must be provided at the time of the docker build, and can be pro
9191
- `NEXT_PUBLIC_LICENSE_CONSENT`
9292
- `NEXT_PUBLIC_WEBAPP_URL`
9393

94+
> If you are self-hosting with a custom domain and OAuth redirects fail with hostname mismatch errors, check `BUILT_NEXT_PUBLIC_WEBAPP_URL` in your running container. If it still points to `http://localhost:3000`, your image was built with localhost values and must be rebuilt with your domain.
95+
9496
#### Important Run-time variables
9597

9698
- `NEXTAUTH_SECRET`
@@ -106,9 +108,25 @@ For more detailed instructions on how to build and configure your own Docker ima
106108

107109
### CLIENT_FETCH_ERROR
108110

109-
If you experience this error, it may be the way the default Auth callback in the server is using the WEBAPP_URL as a base url. The container does not necessarily have access to the same DNS as your local machine, and therefore needs to be configured to resolve to itself. You may be able to correct this by configuring `NEXTAUTH_URL=http://localhost:3000/api/auth`, to help the backend loop back to itself.
111+
If you experience this error, it may be because the Auth callback in the server is using the web app URL as a base URL. The container does not necessarily have access to the same DNS as your local machine and may need to loop back to itself. You may be able to correct this by configuring `NEXTAUTH_URL=http://localhost:3000/api/auth` for internal callback requests while keeping `NEXT_PUBLIC_WEBAPP_URL` set to your public domain.
110112

111113
```
112114
docker-calcom-1 | @calcom/web:start: [next-auth][error][CLIENT_FETCH_ERROR]
113115
docker-calcom-1 | @calcom/web:start: https://next-auth.js.org/errors#client_fetch_error request to http://testing.localhost:3000/api/auth/session failed, reason: getaddrinfo ENOTFOUND testing.localhost
114116
```
117+
118+
### WEBAPP_URL and ALLOWED_HOSTNAMES mismatch
119+
120+
If OAuth loops and logs show messages like `Match of WEBAPP_URL with ALLOWED_HOSTNAMES failed`, verify all of the following:
121+
122+
1. `ALLOWED_HOSTNAMES` is comma-separated without JSON or extra quotes (for example, `ALLOWED_HOSTNAMES=cal.example.com,www.cal.example.com`).
123+
2. `NEXT_PUBLIC_WEBAPP_URL` is set to your public domain.
124+
3. Your image was built with the same public domain values.
125+
126+
Quick check:
127+
128+
```bash
129+
docker compose exec calcom printenv BUILT_NEXT_PUBLIC_WEBAPP_URL
130+
```
131+
132+
If this value does not match your public domain, rebuild your image with the correct build-time args and restart the stack.

0 commit comments

Comments
 (0)