Files
clean-architecture-frontend…/docs/architecture/static-delivery.md
T
DongHyeonka 121e11250a docs(operations): nginx 설정 예시를 지우고 호스트가 지킬 조건만 남긴다
문제: docs/operations/release-cache-rollback.md에 nginx 설정이 통째로
있다(보안 헤더 snippet과 server 블록, 「Example: nginx on a single
server」 절). CI는 그것을 돌리지 않고, 호스트 설정은 개발 repo의 일이
아니다(소유자 2026-11-07). ci-quality-gates.md의 runner 요구 절에도
호스트를 바꾸는 절차(AppArmor profile 본문, sysctl 명령)가 있다.

고른 방법:
- nginx 절을 지우고 같은 문서에 「운영 환경이 지켜야 할 조건」 19개를
  문장으로 쓴다. 조건마다 재는 쪽을 적었다: FE-GATE-019가 잰다(live
  모드, 값은 config/hosting/*.json) / 아무도 재지 않는다. 백엔드와 같은
  절 이름·같은 언어(한국어)다.
- 지운 설정을 한 줄씩 대조했다. snippet 6줄 → 6(값), always → 7;
  listen 443 ssl·server_name·인증서 → 1; http2 → 2; gzip·gzip_types →
  10, gzip_vary → 11; root current와 원자적 symlink 전환 → 17;
  index.html → 3·6; try_files fallback → 4·6; config.json·
  release-manifest.json → 5·6; 공유 /assets/·기간으로 지우기 → 18;
  없는 청크 404 → 12; immutable → 8; service-worker.js → 14·15;
  .map 404 → 16; Cache-Control에 always 없음 → 13; 기본 base path / →
  1; mime.types에 맡긴 Content-Type → 3·5·9·14. 롤백 때 동작은 19.
- static-delivery.md의 "nginx example" 문장은 이 절을 가리키게 고친다.
- ci-quality-gates.md: runner 요구(바이너리, systemd, cgroup, 비특권
  user namespace)는 게이트가 runner에 요구하는 조건이라 남긴다. 고치는
  방법 목록과 AppArmor profile 본문만 지우고 "고치는 방법은
  scripts/check-system-test-prerequisites.ts가 실패할 때 출력한다"로
  바꾼다. 그 스크립트가 같은 세 방법을 출력한다.
버린 대안: nginx 설정을 project-infra나 cicd-platform으로 복사하기.
아무도 시험하지 않는 복사본이 다른 repo에 생긴다(백엔드도 지웠다).

위험·한계: 아무도 재지 않는 부분이 있는 조건이 11개다(7, 8의 나머지 파일,
10의 나머지 청크와 CSS·JSON·SVG, 11, 12, 13, 15, 16의 호스트 쪽, 17의
전환 도중, 18, 19의 호스트 쪽). 지운 nginx 예시도 CI가 돌리지 않았으니
재지 않는 범위는 넓어지지 않았다. AppArmor profile 본문은 이 repo에서
없어진다. 필요하면 runner를 만드는 쪽 인프라 repo가 갖는다.

검증: git grep -n '^```nginx' 0줄. desktop(이 커밋 30a379f 트리, 로그
~/l1-layout-cleanup-logs/): verify:documentation PASS_SCOPED(새 절의
경로·script 이름·FE-GATE ID와 static-delivery.md의 링크 포함),
test:unit 3091 tests 통과.

Refs: design-docs repo-structure/04-frontend-layout.md 4절 I-3·I-4·I-11
2026-11-07 19:02:47 +09:00

3.3 KiB

Static asset and runtime-config delivery

정본 안내 (non-authoritative for runtime capability decisions)

Runtime Config/boot, Fetch HTTP client, Router, Query/Mutation, realtime 공통 경계, Web Worker, Service Worker, offline command와 Background Sync의 구현 결정은 프론트엔드 런타임 Capability 저장소 정합형 구현 결정 폐쇄 상세 설계가 정본이다. 본 문서의 해당 서술이 정본과 충돌하면 정본을 따른다.

This Mermaid view is a repository-local implementation projection. The PASS_SCOPED reviewer evidence applies only to the canonical static-delivery draw.io scope recorded in review-ledger.json.

sequenceDiagram
  participant CI
  participant ImmutableRelease
  participant ActivePointer
  participant Browser
  CI->>ImmutableRelease: upload hashed assets
  CI->>ImmutableRelease: upload release manifest
  CI->>ImmutableRelease: upload runtime config
  CI->>ImmutableRelease: probe asset reachability
  CI->>ActivePointer: atomically switch HTML
  Browser->>ActivePointer: fetch revalidated HTML
  Browser->>ImmutableRelease: fetch no-store config and manifest
  Browser->>ImmutableRelease: fetch immutable hashed assets
  CI->>Browser: boot, route, API, and reload-loop smoke

In this repository the workflow deploys nothing. The upload, pointer switch and smoke steps above belong to the project's provider adapter, which fills the deployment job between promotion and production_gate. After it has deployed the promoted release, FE-GATE-019 probes the live headers and checks that the host serves that release; while the slot is empty FE-GATE-019 is UNVERIFIED (reviews 13-05, 1101/13-01, release-cache-rollback.md).

Rollback changes the active pointer only after confirming that the prior immutable release has a coherent HTML/assets/config/API/manifest tuple.

Serve the app over HTTP/2 or later. The entry preloads every initial JavaScript file in parallel (initialJsFiles in config/performance/budgets.json bounds how many; the current count is initialJavascript.files in config/scale/feature-shape-ceilings.json, which goes with the sample feature). Over HTTP/1.1 they queue for six connections per host, and the first screen on Fast 3G came about one second later than with the initial chunks grouped (2026-11-03). Over HTTP/2 the difference was under 100 ms, so the template keeps the chunks split. A product that can only serve HTTP/1.1 groups its initial chunks in vite.config.ts and measures again whenever the shell changes ("초기 청크 수와 HTTP/1.1" in performance-evidence.md, review 1101/14.4).

Serve JavaScript compressed (gzip, brotli or zstd). The bundle budget counts gzip bytes; uncompressed, the initial JavaScript is about three times larger. Both premises are declared in config/hosting/cache-policy.json (transport.alpnProtocols, hashedAsset.contentEncodings), and the live probe of FE-GATE-019 fails a host that does not meet them (review 1103/13-02). Every condition the host has to meet, and what checks each one, is in 「운영 환경이 지켜야 할 조건」 in release-cache-rollback.md.