Signoz 405 Error Fix
Problem
When trying to register on Signoz UI (http://localhost:3301/signup), you get a 405 Method Not Allowed error from Nginx.
Error Details:
- Request:
POST http://localhost:3301/api/v1/register - Status:
405 Not Allowed - Server:
nginx/1.26.3
Root Cause
The Signoz frontend Docker image has its own Nginx server that serves the React app, but it's not configured to proxy /api/* requests to the query-service. When the frontend makes API calls to /api/v1/register, Nginx tries to serve it as a static file, which fails with 405.
Solution
Added a separate Nginx reverse proxy container that:
- Proxies
/api/*requests tosignoz-query-service:8080 - Proxies all other requests to
signoz-frontend:3301 - Handles CORS and OPTIONS preflight requests
Changes Made
1. Added Infrastructure Nginx Reverse Proxy Container
In docker-compose.dev.yml:
infrastructure-nginx-proxy:
image: nginx:alpine
depends_on:
- signoz-frontend
- signoz-query-service
ports:
- '${SIGNOZ_FRONTEND_PORT:-3301}:3301'
volumes:
- ./config/nginx/infrastructure.conf:/etc/nginx/conf.d/default.conf:ro
networks:
- football-booking-network
Note: The nginx config is now in config/nginx/infrastructure.conf (not config/signoz/) for better scalability. See docs/REVERSE-PROXY-ARCHITECTURE.md for details.
2. Updated Frontend Container
Changed frontend to expose port internally only (not directly to host):
signoz-frontend:
expose:
- '3301' # Internal only, accessed via nginx-proxy
3. Created Nginx Configuration
Created config/signoz/nginx.conf that:
- Proxies
/api/*→signoz-query-service:8080 - Proxies
/→signoz-frontend:3301 - Handles CORS and OPTIONS requests
How to Apply
Step 1: Restart Services
# Stop existing containers
docker compose -f docker-compose.dev.yml stop signoz-frontend signoz-query-service
# Start with new configuration
docker compose -f docker-compose.dev.yml up -d signoz-nginx-proxy signoz-frontend signoz-query-service
Step 2: Verify Nginx Proxy
# Check if nginx-proxy is running
docker ps | grep signoz-nginx-proxy
# Check nginx logs
docker logs signoz-nginx-proxy
# Test API endpoint through proxy
curl -X POST 'http://localhost:3301/api/v1/register' \
-H 'Content-Type: application/json' \
-d '{"email":"test@example.com","name":"Test","orgName":"Test Org","password":"Test123**","isAnonymous":false,"hasOptedUpdates":true}'
Step 3: Test Registration
- Go to http://localhost:3301/signup
- Fill in the registration form
- Click "Get Started"
- Should now work without 405 error
Architecture
Browser
│
│ http://localhost:3301/api/v1/register
▼
┌─────────────────────┐
│ signoz-nginx-proxy │ (Port 3301)
│ (Nginx Reverse │
│ Proxy) │
└──────────┬──────────┘
│
┌──────┴──────┐
│ │
▼ ▼
┌──────────┐ ┌──────────────────┐
│ Frontend │ │ Query Service │
│ :3301 │ │ :8080 │
└──────────┘ └──────────────────┘
Troubleshooting
Still Getting 405?
- Check if nginx-proxy is running:
bash
docker ps | grep infrastructure-nginx-proxy
- Check nginx configuration:
bash
docker exec infrastructure-nginx-proxy nginx -t
- Check nginx logs:
bash
docker logs infrastructure-nginx-proxy
- Verify query-service is accessible:
bash
curl http://localhost:8083/api/health
- Test direct API call:
bash curl -X POST 'http://localhost:8083/api/v1/register' \ -H 'Content-Type: application/json' \ -d '{"email":"test@example.com","name":"Test","orgName":"Test","password":"Test123**","isAnonymous":false}'
CORS Errors?
The Nginx config includes CORS headers. If you still see CORS errors:
- Check browser console for specific error
- Verify
Access-Control-Allow-Originheader is present - Check if OPTIONS preflight is being handled
Frontend Not Loading?
- Check frontend container:
bash
docker logs signoz-frontend
- Verify frontend is accessible internally:
bash
docker exec signoz-nginx-proxy wget -O- http://signoz-frontend:3301
- Check network connectivity:
bash docker network inspect football-booking-network | grep signoz
Alternative Solutions
If the Nginx proxy approach doesn't work, you can:
- Access query-service directly (but will have CORS issues):
- Change frontend to call
http://localhost:8083/api/v1/registerdirectly -
Requires modifying Signoz frontend code (not recommended)
-
Use Signoz unified service (newer versions):
- Some newer Signoz versions have a unified frontend+API service
-
Check Signoz documentation for latest setup
-
Custom frontend build:
- Rebuild Signoz frontend with custom API endpoint configuration
- More complex but gives full control
Notes
- The Nginx proxy adds a small latency overhead (~1-2ms)
- All API requests now go through the proxy
- Static assets are still served efficiently
- CORS is handled at the proxy level
Verification
After applying the fix, you should be able to:
- ✅ Access Signoz UI at http://localhost:3301
- ✅ Register a new account without 405 errors
- ✅ Make API calls through the proxy
- ✅ See traces, metrics, and logs in Signoz