Skip to content
Login Changemaker Archive. Learn more

# Static Site Server

Nginx-powered static site server for hosting built documentation and websites.

## Overview

The Static Site Server uses Nginx to serve your built documentation and static websites. It's configured to serve the built MkDocs site and other static content with high performance and reliability.

## Features

- High-performance static file serving
- Automatic index file handling
- Gzip compression
- Caching headers
- Security headers
- Custom error pages
- URL rewriting support

## Access

- Default Port: 4001
- URL: `http://localhost:4001`
- Document Root: `/config/www` (mounted from `./mkdocs/site`)

## Configuration

### Environment Variables

- `PUID`: User ID for file permissions (default: 1000)
- `PGID`: Group ID for file permissions (default: 1000)
- `TZ`: Timezone setting (default: Etc/UTC)

### Volumes

- `./mkdocs/site:/config/www`: Static site files
- Built MkDocs site is automatically served

## Usage

1. Build your MkDocs site: `docker exec mkdocs-changemaker mkdocs build`
2. The built site is automatically available at `http://localhost:4001`
3. Any files in `./mkdocs/site/` will be served statically

## File Structure

    mkdocs/site/           # Served at /
    ├── index.html         # Homepage
    ├── assets/           # CSS, JS, images
    ├── services/         # Service documentation
    └── search/           # Search functionality

## Performance Features

- Gzip Compression: Automatic compression for text files
- Browser Caching: Optimized cache headers
- Fast Static Serving: Nginx optimized for static content
- Security Headers: Basic security header configuration

## Custom Configuration

For advanced Nginx configuration, you can: 1. Create custom Nginx config files 2. Mount them as volumes 3. Restart the container

## Monitoring

Monitor the static site server through: - Container logs: `docker logs mkdocs-site-server-changemaker` - Access logs for traffic analysis - Performance metrics

## Troubleshooting

### Common Issues

- 404 Errors: Ensure MkDocs site is built and files exist in `./mkdocs/site/`
- Permission Issues: Check `PUID` and `PGID` settings
- File Not Found: Verify file paths and case sensitivity

### Debugging

    # Check container logs
    docker logs mkdocs-site-server-changemaker

    # Verify files are present
    docker exec mkdocs-site-server-changemaker ls -la /config/www

    # Test file serving
    curl -I http://localhost:4001

## Official Documentation

For more information about the underlying Nginx server: - LinuxServer.io Nginx - Nginx Documentation