Nginx Configuration
Before You Start
Make sure you know these values before editing Nginx:
Dashboard domain (example:
panel.example.com)Web API domain (example:
api.example.com)Dashboard local URL (example:
http://127.0.0.1:3222)Web API local URL (example:
http://127.0.0.1:3111)
Using two subdomains is recommended when transcripts and API routes are served together.
Use different ports for Dashboard and Web API. Do not expose those internal ports directly to the public internet when using Nginx as a reverse proxy.
HTTP-Only Configuration (Testing)
Use this only for local testing or private networks.
Create a site file in Nginx (for example /etc/nginx/sites-available/athena-dashboard) and add:
server {
listen 80;
server_name panel.example.com;
# Dashboard frontend + dashboard API
location / {
proxy_pass http://127.0.0.1:3222;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}
server {
listen 80;
server_name api.example.com;
# AthenaBot Web API + transcripts
location / {
proxy_pass http://127.0.0.1:3111;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}This is a testing-only setup. For production, use HTTPS on both subdomains.
HTTPS Configuration (Recommended)
For production, use HTTPS with a valid certificate.
AthenaBot Config Values When Using Nginx
Set your Dashboard and Web API URLs in common.json to public-facing values:
In your Web API config (web_api.json(5)), set base_ip to your API domain (example: api.example.com).
In Discord Developer Portal OAuth2 redirects, use:
The redirect URL must match exactly, including protocol (http or https), domain, and path.
Enable and Test
After saving your Nginx file:
Test syntax:
Reload Nginx:
Start AthenaBot and test:
Open
https://panel.example.comConfirm dashboard login works
Confirm data loads without
fetch failed
Common Problems
If the dashboard does not load correctly:
502 Bad GatewayDashboard or Web API is not running on the target local port.
proxy_passpoints to the wrong host/port.
fetch failedor API errorsweb_api_base_urldoes not match your API subdomain.Web API
authentication_keyis invalid/default.
OAuth redirect loop or login failure
Redirect URL in Discord Developer Portal does not exactly match the active dashboard URL.
Cloudflare / reverse proxy rate-limit issues
Set Web API
rate_limit.proxiedtotrue.Keep only trusted proxy paths publicly exposed.
Last updated