# FE nginx consolidation — review & apply

## What changes

- **`/etc/nginx/apps.conf`** becomes the full `apps.f0xx.org` vhost (HTTP redirect + HTTPS server + all Android Cast locations).
- **`/etc/nginx/nginx.conf`** drops inline `apps.f0xx.org` server blocks; adds one `include /etc/nginx/apps.conf;` at `http` level.

## New / consolidated paths in apps.conf

| Path | Upstream |
|------|----------|
| `/v0/ota/` | BE :80 (OTA) |
| `/app/androidcast_project/build/` | BE :80 |
| `/app/androidcast_project/crashes/` | BE :80 |
| `/app/androidcast_project/graphs/` | BE :80 (explicit) |
| `/app/androidcast_project/` | BE :80 (hub) |
| `/app/androidcast_project/git/` | BE :3000 (Gitea) |
| `/` (default) | BE :80 |

Canonical template: `examples/crash_reporter/backend/nginx/fe/apps.conf`

## Apply (on f0xx-monstro)

```bash
cd /etc/nginx
cp -a apps.conf "apps.conf.bak.$(date +%Y%m%d)"
cp -a nginx.conf "nginx.conf.bak.$(date +%Y%m%d)"
# copy template from repo sync, or patch:
# patch -p1 < .../fe-nginx-apps-consolidation.patch
cp /path/to/android_cast/examples/crash_reporter/backend/nginx/fe/apps.conf apps.conf
# edit nginx.conf: replace apps.f0xx.org server {…} blocks with:
#   include /etc/nginx/apps.conf;
nginx -t && rc-service nginx reload
```

## Verify

```bash
curl -sS -o /dev/null -w 'hub %{http_code}\n' https://apps.f0xx.org/app/androidcast_project/
curl -sS -o /dev/null -w 'ota %{http_code}\n' https://apps.f0xx.org/v0/ota/channel/stable.json
curl -sS -o /dev/null -w 'build %{http_code}\n' https://apps.f0xx.org/app/androidcast_project/build/
```
