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

# Static Site

> Static HTML/CSS/JS preset with nginx.

The Static preset serves files directly via nginx — ideal for HTML sites, single-page applications, documentation, and landing pages.

## What's Included

| Component | Version               | Details                         |
| --------- | --------------------- | ------------------------------- |
| **nginx** | Latest (Ubuntu 24.04) | Web server, auto-starts on boot |
| **git**   | Latest                | Version control                 |
| **SSH**   | OpenSSH               | Access via dedicated port       |

Pre-installed utilities: curl, wget, vim, htop, unzip.

## Directory Structure

```
/home/instapod/app/
├── index.html          # Default welcome page
└── (your files here)
```

* **App Root**: `/home/instapod/app`
* **Public Root**: `/home/instapod/app` (same — everything is public)
* **Port**: 80 (nginx)
* **nginx config**: `/etc/nginx/sites-available/default`

## Deploying Your Site

### Upload Files

```bash theme={null}
# Upload a single file
instapods files upload my-site ./index.html

# Sync an entire directory
instapods files sync my-site --local ./dist

# Or use the deploy command (auto-detects preset)
instapods deploy my-site --local ./dist
```

### SCP

```bash theme={null}
scp -P YOUR_PORT -r ./dist/* instapod@YOUR_HOST:/home/instapod/app/
```

### Git Clone (via Terminal)

```bash theme={null}
instapods exec my-site -- git clone https://github.com/you/your-site /home/instapod/app
```

## Reloading

After updating files, reload nginx to pick up configuration changes:

```bash theme={null}
instapods pods reload my-site
```

<Note>
  For static files, nginx serves them directly — no reload is needed for simple HTML/CSS/JS changes. Only reload if you've modified the nginx configuration.
</Note>

## Single-Page Applications (SPA)

The default nginx config uses `try_files $uri $uri/ =404`, which returns 404 for routes that don't match a file. For SPAs with client-side routing (React Router, Vue Router, etc.), you need to redirect all requests to `index.html`.

Connect via SSH or the web terminal and update the nginx config:

```bash theme={null}
sudo sed -i 's|try_files $uri $uri/ =404;|try_files $uri $uri/ /index.html;|' /etc/nginx/sites-available/default
sudo nginx -t && sudo systemctl reload nginx
```

This makes routes like `/about` or `/dashboard` serve your `index.html`, letting your JavaScript router handle them.

## Use Cases

* Static HTML/CSS/JS websites
* Single-page applications (React, Vue, Svelte builds)
* Documentation sites (VitePress, Docusaurus output)
* Landing pages and marketing sites
* File hosting
