Skip to content

Examples

Ready-to-use Navigator configurations for common scenarios. Each example is complete and tested.

Updated for v0.12.0

All examples have been updated to use the new configuration structure introduced in v0.12.0. The configuration format has changed significantly - see the YAML Reference for migration details.

Quick Reference

Example Use Case Key Features
Single Rails App Basic Rails application Simple setup, static files
Multi-Tenant Multiple customers/databases Isolated apps, path routing
With Redis Caching and sessions Managed Redis process
With Sidekiq Background jobs Worker process management
Action Cable WebSockets Real-time features

Choose Your Scenario

I want to serve a single Rails application

→ Start with Single Rails App

I have multiple customers with separate databases

→ See Multi-Tenant Setup

I need background job processing

→ Check With Sidekiq

I need WebSocket support

→ Read Action Cable

I'm deploying to Fly.io

→ Follow Fly.io Deployment

I need a systemd service

→ Use Systemd Service

Configuration Templates

All examples follow this structure:

# Server configuration
server:
  listen: 3000
  static:
    public_dir: ./public

# Authentication (optional)
auth:
  enabled: false

# Applications
applications:
  tenants: []

# Managed processes (optional)
managed_processes: []

# Routing rules (optional)
routes:
  rewrites: []
  fly:
    replay: []

Tips for Using Examples

  1. Start Simple: Begin with the basic example closest to your needs
  2. Modify Gradually: Make small changes and test each one
  3. Check Logs: Use LOG_LEVEL=debug for troubleshooting
  4. Test Locally: Verify configuration before deploying
  5. Use Absolute Paths: In production, use absolute paths for directories

Common Patterns

Environment-Specific Configuration

Use environment variables for different environments:

applications:
  global_env:
    RAILS_ENV: "${RAILS_ENV:-development}"
    DATABASE_URL: "${DATABASE_URL}"

Path-Based Routing

Route different paths to different apps:

applications:
  tenants:
    - name: api
      path: /api/
    - name: admin
      path: /admin/
    - name: main
      path: /

Resource Limits

Control resource usage:

pools:
  max_size: 10
  idle_timeout: 300
  start_port: 4000

Need Help?