# Task 2 Report: nginx `/web` 反代（GREEN）

**Task ID**: task-2  
**Status**: ✅ SUCCESS  
**Commits**: none (per instructions)

## Deliverable

Inserted `/web` location block in `deploy/baota/nginx.rewrite` after `/mobile/` SPA block, before `location = /` and `location /`.

## Implementation

- `location = /web` → `return 301 /web/;`
- `location ^~ /web/` → `proxy_pass http://127.0.0.1:3000;` (no trailing slash)
- Upgrade headers: `proxy_http_version 1.1`, `Upgrade`, `Connection "upgrade"`
- Standard proxy headers: Host, X-Real-IP, X-Forwarded-For, X-Forwarded-Proto

## Verification Evidence (GREEN)

```text
$ bash tests/deploy/baota/test-nginx-web-location.sh
EXIT: 0
```

All assertions pass:
- `location = /web` with 301 redirect
- `location ^~ /web/` with proxy_pass (no trailing slash)
- `/web/` block precedes `location / {`
- Regression: `/api/`, `/admin/`, `/mobile/` unchanged

## Self-Review

- Block placement matches brief (after mobile, before root redirect)
- No trailing slash on `proxy_pass` URL
- `/admin/`, `/mobile/`, `/api/` semantics untouched
- `pack.sh` / `install.sh` not modified

## Concerns

None. Runtime behavior depends on Nuxt process on `127.0.0.1:3000` (out of scope for this task).
