Nginx Configuration Migration Summary
What Changed
Before (Signoz-Specific)
config/
└── signoz/
├── nginx.conf # Signoz-only nginx config
├── dashboards/
├── alerts/
└── otel-collector-config.yaml
After (Scalable Structure)
config/
├── nginx/ # All nginx reverse proxy configs
│ ├── infrastructure.conf # Unified config for all infrastructure tools
│ └── README.md # Documentation
└── signoz/ # Signoz-specific configs only
├── dashboards/
├── alerts/
└── otel-collector-config.yaml
Why This Change?
Problems with Old Structure:
- Not scalable: Adding new tools (PgAdmin, Grafana) would require modifying Signoz config
- Confusing: Nginx config in Signoz folder suggests it's Signoz-only
- Hard to maintain: Multiple nginx configs scattered across service folders
Benefits of New Structure:
- Scalable: Easy to add new infrastructure tools
- Clear separation: Infrastructure proxy vs. service-specific configs
- Better organization: All reverse proxy configs in one place
- Future-proof: Ready for Grafana, Prometheus, etc.
Changes Made
1. Created config/nginx/ Directory
- New location for all nginx reverse proxy configurations
- Separate from service-specific configs
2. Created infrastructure.conf
- Unified configuration for all infrastructure tools
- Currently handles Signoz (port 3301)
- Ready for PgAdmin, Mongo Express, Grafana, etc.
3. Updated Docker Compose
- Renamed
signoz-nginx-proxy→infrastructure-nginx-proxy - Updated volume mount:
./config/nginx/infrastructure.conf - Updated port mapping:
3301:3301(was3301:80)
4. Updated Documentation
docs/REVERSE-PROXY-ARCHITECTURE.md- Architecture explanationdocs/SIGNOZ-405-FIX.md- Updated with new pathsconfig/nginx/README.md- How to add new tools
Migration Steps
✅ Completed
- Created
config/nginx/directory - Created
infrastructure.confwith Signoz configuration - Updated
docker-compose.dev.yml - Created documentation
🔄 Next Steps (When Ready)
- Restart services:
bash
docker compose -f docker-compose.dev.yml down infrastructure-nginx-proxy
docker compose -f docker-compose.dev.yml up -d infrastructure-nginx-proxy
- Verify it works:
bash
curl http://localhost:3301/health
curl -X POST http://localhost:3301/api/v1/register ...
- Optional: Remove old file (after verification):
bash # Keep as backup for now, can remove later # rm config/signoz/nginx.conf
Architecture Overview
Two-Tier Proxy System
┌─────────────────────────────────────────┐
│ Client Requests │
└──────────────┬──────────────────────────┘
│
┌──────────┴──────────┐
│ │
▼ ▼
┌──────────┐ ┌──────────────────┐
│ API │ │ Infrastructure │
│ Gateway │ │ Nginx Proxy │
│ (NestJS) │ │ (config/nginx/) │
│ Port 3000│ │ Port 3301, etc. │
└──────────┘ └──────────────────┘
│ │
Business Services Infrastructure Tools
(user, booking) (Signoz, PgAdmin)
Adding New Tools
Example: Add PgAdmin
- Edit
config/nginx/infrastructure.conf:
nginx
server {
listen 5050;
server_name localhost;
location / {
proxy_pass http://pgadmin:80;
# ... proxy headers
}
}
- Update
docker-compose.dev.yml:
yaml
infrastructure-nginx-proxy:
ports:
- '${SIGNOZ_FRONTEND_PORT:-3301}:3301'
- '${PGADMIN_PORT:-5050}:5050' # Add this
- Restart:
bash docker compose -f docker-compose.dev.yml restart infrastructure-nginx-proxy
That's it! No need to create new nginx containers or modify Signoz configs.
Benefits for Future Scaling
- Single entry point for all infrastructure tools
- Consistent configuration across all tools
- Easy to add SSL/TLS (one place to configure)
- Easy to add authentication (one place to configure)
- Better monitoring (one proxy to monitor)
Questions?
See:
docs/REVERSE-PROXY-ARCHITECTURE.md- Full architecture explanationconfig/nginx/README.md- How to add new toolsdocs/SIGNOZ-405-FIX.md- Original fix documentation