Core Settings
These key settings enhance the security, flexibility, and performance of the Lunar.dev API Consumption Gateway. While not all settings are mandatory, they are highly recommended to ensure your API traffic is managed securely and efficiently.
While not all configurations are mandatory, they are highly recommended to ensure optimized communication, secure connections, and reliable traffic management. Below is a breakdown of each configuration, why it matters, and how it is relevant to your system setup.
📄️ mTLS Configuration
Mutual Transport Layer Security (mTLS) is a protocol that provides both authentication and encryption for communication between two parties. It ensures that only authorized entities can communicate, and that their data is protected from eavesdropping and tampering. Below is a guide on how to configure mTLS for Lunar.dev's API Consumption Gateway.
📄️ SSL Communication with Lunar.dev Gateway
This page provides guidance on encrypting requests between your clients and the Lunar.dev API Consumption Gateway using TLS. Follow the steps below to secure traffic.
📄️ Path Parameters Configuration
Path parameters allow you to create flexible and reusable URL patterns by defining variable segments within the URL. This enables you to group similar endpoints and apply consistent policies across them.
📄️ Identify Your API Consumer
Lunar supports the ability to identify and segment requests based on the x-lunar-consumer-tag header. This feature allows users to add a custom header to their HTTP requests, enabling better visibility and control in Lunar Control Plane.
🗃️ Environment Variables
2 items
📄️ Failsafe Mechanisms
Lunar.dev Failsafe Mechanisms help guarantee that your application remains operational, ensuring uninterrupted API traffic even when unexpected issues arise.
📄️ Lunar Logs
Logging is essential for monitoring, troubleshooting, and optimizing the Lunar.dev API Consumption Gateway. Logs are stored in /var/log/lunar-proxy, with key files providing insights into specific operations:
Security and Communication Configurations
Securing and structuring communication between clients, gateways, and API providers is essential for maintaining data integrity and performance.
The following configurations help ensure your API traffic is managed safely and efficiently.
-
Mutual TLS (mTLS) guarantees that both the client and server authenticate each other before establishing a connection. This is critical in environments that require end-to-end encryption and secure communication.
Use this configuration when you need to enforce secure communication between your application and the API provider. It’s particularly valuable in highly regulated industries where data security is a priority.
-
SSL Communication with Lunar Gateway
SSL encryption secures the traffic between the Lunar Gateway and external API providers. This protects sensitive data from being exposed during transmission.
Implement SSL communication to ensure encrypted traffic between your infrastructure and third-party APIs, preventing unauthorized access to data.
Traffic Structuring Configurations
To efficiently manage and optimize traffic flow, it’s essential to structure and segment your API traffic. These configurations help organize traffic routes and provide flexibility in routing and request management.
-
Defining reusable URL patterns makes managing API endpoints more efficient. This is particularly useful when handling large numbers of similar API requests.
Apply this configuration to manage path parameters and reduce redundancy when managing multiple API endpoints. This is especially helpful for simplifying complex URL structures.
-
Identifying and segmenting API requests is crucial for monitoring usage and traffic patterns across different applications or environments.
Use the
x-lunar-consumer-tag
header to label API requests based on the application or user, providing granular insights and tracking capabilities for multi-tenant environments.
Runtime Configurations
Optimizing runtime settings is vital for ensuring smooth operations, especially during high traffic or system shutdowns. These configurations focus on fine-tuning the behavior of Lunar.dev components.
-
Configuring environment variables allows you to tailor the operation of the Lunar Gateway and Interceptors based on your infrastructure’s specific needs.
Use environment variables to adjust runtime behaviors like connection settings, logging, and fail-safe mechanisms. This gives you more control over how the gateway operates in different environments.
-
To ensure uninterrupted traffic flow during system failures, the Failsafe Mechanism reroutes traffic directly to API providers, preventing downtime.
This configuration is essential in maintaining high availability, ensuring your system continues to function smoothly even if the Lunar Gateway or Interceptor experiences issues.
Lunar Logs
Logging is essential for troubleshooting and optimizing the Lunar Gateway’s performance. Review logs for detailed insights into traffic patterns, errors, and performance metrics. Logs are critical for diagnosing issues and ensuring system reliability.