> ## Documentation Index
> Fetch the complete documentation index at: https://docs-v2.ard.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Nginx Service

> Nginx service for querying registry metadata and checking available archived runs

The Nginx service provides HTTP access to registry metadata and archived file listings on MAMS servers. It enables services like Sahabah to discover available archived model runs.

## Purpose

Each MAMS server (main and archive servers) runs an Nginx service on port `8083`. Primary functions:

* **Registry metadata**: Query `registry.json` to discover which models and date ranges are available on each server
* **Available runs discovery**: List directories for a given model and date to determine which runs are archived for that day
* **File serving**: HTTP access to archived NetCDF files

<Note>
  Used by the Sahabah service to query registry metadata and discover available archived runs.
</Note>

## Deployment

* **Main Server**: Service `mams-archive_mams-local-archive` on port `8083`
* **Archive Servers**: Service `mams-archive_mams-archive` on port `8083`

## Authentication

* **Nginx (Registry)**: `mams` / `archive2025` (port 8083)
* **ModMS Query/Web**: `modms` / `CLandSky` (port 8081)

## Endpoints

### Main Server

**Base URL**: `http://mams.devops.arabiaweather.com:8083`

* **`GET /archives/meta`**: Serves `registry.json` with information about models and date ranges on each server
* **`GET /archives/registry.json`**: Direct access to registry file (same as `/archives/meta`)
* **`GET /archives/{path}`**: Serves archived files and provides JSON directory listings
* **`GET /health`**: Health check (no authentication required)

<Note>
  `/archives/meta` endpoint is only available on the main MAMS server, not on archive servers.
</Note>

### Archive Servers

**Base URL**: `http://138.201.49.117:8083` (example for Mams.04)

* **`GET /archives/{path}`**: Serves archived files and directory listings
* **`GET /health`**: Health check (no authentication required)

For example requests, see the [API Examples](/data-ai/modms/mams/api-examples) page.

## Features

* **Directory listing**: JSON format with human-readable sizes and local time
* **Caching**: 5-minute cache for static content, 1-minute for registry metadata
* **Security headers**: X-Content-Type-Options, X-Frame-Options, X-XSS-Protection
* **CORS**: Enabled for API access
* **Compression**: Gzip enabled for text, JSON, and XML files

## Use Cases

### Discovering Available Runs

1. Query `/archives/meta` to find which server has the data
2. List directories for that model/date on the appropriate server
3. Directory listing shows available run times

### Sahabah Service Integration

* Query registry metadata via `APP__WEATHER__MAMS_REGISTRY_URL` (port 8083)
* Discover available archived runs by listing directories
* Query actual data via `APP__WEATHER__MAMS_QUERY_URL` (port 8081)

## Related Documentation

* [MAMS API Examples](/data-ai/modms/mams/api-examples) - Example requests and workflows
* [MAMS Overview](/data-ai/modms/mams) - MAMS system overview
* [MAMS Deployment](/data-ai/modms/mams/deployment) - Deployment details
