nginx-discovery
Parse, analyze, and extract information from NGINX configurations with powerful export and health checking capabilities.
Features
- 🔍 Parse NGINX configs - Parse any NGINX configuration file
- 📊 Multiple Export Formats - Export to JSON, YAML, TOML, or Markdown
- 🔌 Export Filtering - Filter by server name, port, SSL status, or directive
- 🌐 Network Health Checks - Check port availability, DNS resolution, SSL certificates, and upstream backends
- 🐚 Shell Completions - Generate completions for Bash, Zsh, Fish, PowerShell, Elvish
- 🚀 High Performance - Fast parsing with minimal memory footprint
- 📦 Library & CLI - Use as a library or standalone CLI tool
Installation
As a Library
Add to your Cargo.toml:
[]
= "0.4.0"
# With optional features
= { = "0.4.0", = ["serde", "network", "export-all"] }
As a CLI Tool
Quick Start
Library Usage
use ;
Export to Different Formats
use ;
use io;
Network Health Checks
use ;
async
CLI Usage
# Parse and display configuration
# Export to JSON
# Export to Markdown report
# Filter by server name
# Check network health
# Check specific ports
# Generate shell completions
Feature Flags
| Feature | Description | Default |
|---|---|---|
serde |
Enable serialization support (JSON, YAML) | ✅ |
system |
Enable system interaction (file finding) | ✅ |
export-toml |
Enable TOML export format | ❌ |
export-markdown |
Enable Markdown export format | ❌ |
export-all |
Enable all export formats | ❌ |
network |
Enable network health checking | ❌ |
cli |
Enable CLI binary | ❌ |
full |
Enable all features | ❌ |
Examples
See the examples/ directory for more examples:
- export_formats.rs - Export to different formats
- network_checks.rs - Network health checking
Documentation
Requirements
- Rust 1.70.0 or later
- For network features: tokio runtime
License
Licensed under either of:
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contributing
Contributions are welcome! Please see CONTRIBUTING.md for details.
Acknowledgments
Built with ❤️ for the NGINX community.