Environment
- OpenWA version: v0.1.6
- Deployment: Docker + external Traefik reverse proxy
- OS: Ubuntu 24.04
- Dashboard URL: custom domain via Traefik (e.g. wa.domain.com)
- API URL: separate subdomain via Traefik (e.g. wa-api.domain.com)
Description
When deploying OpenWA with an external Traefik instance (not the bundled one via with-proxy profile),
the dashboard consistently shows "Invalid API Key" even when using the correct key from logs and .api-key file.
The API itself works correctly — confirmed via curl:
curl -s http://localhost:2785/api/health \
-H "X-API-Key: <valid-key>"
# returns: {"status":"ok","timestamp":"..."}
Root Cause
The dashboard is a static React app served by Nginx. The Dockerfile.traefik builds the frontend
with the API URL hardcoded (likely http://localhost:2785), which works when both containers share
the same network but breaks in the browser because localhost resolves to the user's machine,
not the VPS.
Additionally, the default nginx/conf.d/default.conf generated by Dockerfile.traefik has no
/api proxy block:
server {
listen 80;
server_name localhost;
root /usr/share/nginx/html;
index index.html;
location / {
try_files $uri $uri/ /index.html;
}
}
Fix Applied
Adding a proxy block to the Nginx config so /api requests are forwarded to the openwa-api container:
server {
listen 80;
server_name localhost;
root /usr/share/nginx/html;
index index.html;
location /api {
proxy_pass http://openwa-api:2785;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
location / {
try_files $uri $uri/ /index.html;
}
}
Suggested Fix
The Dockerfile.traefik or the dashboard's nginx/conf.d/default.conf should include the /api
proxy block by default, or the React app should support a runtime VITE_API_URL environment variable
so users can point the dashboard to the correct API URL without rebuilding.
Steps to Reproduce
- Clone the repo
- Deploy with
docker compose up -d using docker-compose.override.yml with external Traefik labels
- Access dashboard via public domain
- Enter valid API key → "Invalid API Key" error
Additional Notes
- The bundled
with-proxy profile (internal Traefik) was not tested — this issue is specific to
users bringing their own reverse proxy.
- The API key itself is valid and works via direct curl to the API container.
Environment
Description
When deploying OpenWA with an external Traefik instance (not the bundled one via
with-proxyprofile),the dashboard consistently shows "Invalid API Key" even when using the correct key from logs and
.api-keyfile.The API itself works correctly — confirmed via curl:
Root Cause
The dashboard is a static React app served by Nginx. The
Dockerfile.traefikbuilds the frontendwith the API URL hardcoded (likely
http://localhost:2785), which works when both containers sharethe same network but breaks in the browser because
localhostresolves to the user's machine,not the VPS.
Additionally, the default
nginx/conf.d/default.confgenerated byDockerfile.traefikhas no/apiproxy block:Fix Applied
Adding a proxy block to the Nginx config so
/apirequests are forwarded to theopenwa-apicontainer:Suggested Fix
The
Dockerfile.traefikor the dashboard'snginx/conf.d/default.confshould include the/apiproxy block by default, or the React app should support a runtime
VITE_API_URLenvironment variableso users can point the dashboard to the correct API URL without rebuilding.
Steps to Reproduce
docker compose up -dusingdocker-compose.override.ymlwith external Traefik labelsAdditional Notes
with-proxyprofile (internal Traefik) was not tested — this issue is specific tousers bringing their own reverse proxy.