Skip to content

Server Configuration Commands

Commands for generating server infrastructure configuration files.


generate-nginx-config

Generate an NGINX reverse proxy configuration file for Faraday Server, including SSL/TLS termination and WebSocket proxying.

faraday-manage generate-nginx-config [OPTIONS]

Options

All options are prompted interactively if not provided on the command line.

Option Type Default Description
--fqdn String (prompted) Fully Qualified Domain Name of the Faraday server (e.g., faraday.example.com)
--port Integer 5985 Faraday server HTTP listening port
--ws-port Integer 9000 Faraday WebSocket service listening port
--ssl-certificate Path (prompted) Filesystem path to the SSL certificate file (must exist)
--ssl-key Path (prompted) Filesystem path to the SSL private key file (must exist)
--multitenant-url String (optional) URL prefix for multitenant configuration

Behavior

  1. Displays a summary of the configuration parameters
  2. Asks for confirmation before generating
  3. Renders an NGINX config from a Jinja2 template (nginx_config.j2)
  4. Outputs the configuration to stdout (does not write to a file automatically)
  5. Static files path is auto-detected based on the Python version: /opt/faraday/lib/python<version>/site-packages/faraday/server/www

Examples

# Interactive mode (recommended)
faraday-manage generate-nginx-config
# Server FQDN: faraday.example.com
# Faraday port [5985]: 5985
# Faraday Websocket port [9000]: 9000
# SSL Certificate Path: /etc/ssl/certs/faraday.crt
# SSL Key Path: /etc/ssl/private/faraday.key

# Non-interactive mode
faraday-manage generate-nginx-config \
  --fqdn faraday.example.com \
  --port 5985 \
  --ws-port 9000 \
  --ssl-certificate /etc/ssl/certs/faraday.crt \
  --ssl-key /etc/ssl/private/faraday.key

# With multitenant URL prefix
faraday-manage generate-nginx-config \
  --fqdn faraday.example.com \
  --port 5985 \
  --ws-port 9000 \
  --ssl-certificate /etc/ssl/certs/faraday.crt \
  --ssl-key /etc/ssl/private/faraday.key \
  --multitenant-url tenant1

Output

The command prints the NGINX configuration to stdout. Redirect to a file and place it in your NGINX configuration directory:

faraday-manage generate-nginx-config > /etc/nginx/sites-available/faraday
ln -s /etc/nginx/sites-available/faraday /etc/nginx/sites-enabled/faraday
nginx -t && systemctl reload nginx

Typical NGINX Configuration

The generated config includes: - HTTP to HTTPS redirect - SSL certificate configuration - Reverse proxy to Faraday API (localhost:5985) - WebSocket proxy to Faraday WebSocket service (localhost:9000) - Static file serving from the Faraday installation directory - Proxy headers (X-Forwarded-For, X-Real-IP, etc.)