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

# NGINX Templates

> Customize NGINX configuration templates for your sites in Loupp

## Overview

NGINX templates allow you to customize the web server configuration that is generated for new sites. Modify the template to include custom NGINX directives, security headers, or performance optimizations that will be applied to all new site deployments.

<Card title="Related Documentation" icon="link" href="/sites/create">
  Learn how to create sites that use these NGINX templates.
</Card>

## Template Management

### Core Features

<CardGroup cols={3}>
  <Card title="Custom Templates" icon="code">
    Edit NGINX configuration templates
  </Card>

  <Card title="Variable Support" icon="variable">
    Use dynamic variables for site-specific values
  </Card>

  <Card title="Template Persistence" icon="save">
    Save templates for use with new sites
  </Card>
</CardGroup>

## Template Variables

### Available Variables

<AccordionGroup>
  <Accordion title="$DOMAIN_NAME">
    **Usage**: `server_name $DOMAIN_NAME;`

    **Value**: Automatically replaced with the actual domain name

    **Example**: `example.com` becomes `server_name example.com;`
  </Accordion>

  <Accordion title="$PUBLIC_DIRECTORY">
    **Usage**: `root $PUBLIC_DIRECTORY;`

    **Value**: Automatically set to `/current/public`

    **Important**: This value should not be changed as it's required for zero downtime deployments and rollback processes
  </Accordion>
</AccordionGroup>

### Variable Usage

<Warning>
  The `$PUBLIC_DIRECTORY` variable is set to `/current/public` and should not be modified. This path is essential for Loupp's zero downtime deployment and rollback processes to function correctly.
</Warning>

<Info>
  Template variables are automatically replaced with actual values when NGINX configurations are generated for new sites.
</Info>
