Skip to content

Add Vercel backend rewrites#29

Merged
kim-subsub merged 2 commits into
developfrom
feat/27
Apr 24, 2026
Merged

Add Vercel backend rewrites#29
kim-subsub merged 2 commits into
developfrom
feat/27

Conversation

@kim-subsub

@kim-subsub kim-subsub commented Apr 24, 2026

Copy link
Copy Markdown
Contributor

Summary

관련 있는 Issue를 태그해주세요. (e.g. closed, fixed, resolved, related, #100)

해당 PR에 대한 작업 요약을 작성해주세요.

Tasks

  • 해당 PR에 수행한 작업을 작성해주세요.

Summary by CodeRabbit

릴리스 노트

  • Chores
    • 애플리케이션 배포 구성을 업데이트했습니다. Vercel 재작성 규칙을 통해 백엔드 서비스로의 요청 라우팅을 설정했습니다.

@vercel

vercel Bot commented Apr 24, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
veri-q Ready Ready Preview, Comment Apr 24, 2026 9:17am

@coderabbitai

coderabbitai Bot commented Apr 24, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@kim-subsub has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 28 minutes and 39 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 28 minutes and 39 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: eea0ca11-4cbf-41b3-a088-f66c016c548b

📥 Commits

Reviewing files that changed from the base of the PR and between a4b565a and ecc645b.

📒 Files selected for processing (5)
  • .env.example
  • api/_proxy.js
  • api/be1/[...path].js
  • api/be3/[...path].js
  • vercel.json

Walkthrough

새로운 vercel.json 파일을 생성하여 두 개의 Vercel 재작성 경로를 정의합니다. /be1/*/be3/* 경로 요청을 각각 지정된 백엔드 서버로 전달하는 라우팅 규칙을 추가합니다.

Changes

Cohort / File(s) Summary
Vercel 설정
vercel.json
백엔드 서버 라우팅을 위한 재작성 규칙 추가. /be1/* 요청을 http://34.64.182.89:8081/*로, /be3/* 요청을 http://34.64.182.89:8083/*로 전달하도록 설정
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed PR 제목 'Add Vercel backend rewrites'는 변경사항의 주요 내용을 명확하게 설명합니다. 새로운 vercel.json 파일이 생성되었고 Vercel 백엔드 리라이트 규칙 두 개가 추가되었으며, 제목이 이를 정확하게 반영합니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@vercel.json`:
- Line 5: The rewrite destination currently points to an HTTP URL with a fixed
public IP ("destination": "http://34.64.182.89:8081/:path*"); update it to use
an HTTPS domain-based endpoint and remove the hardcoded IP (e.g., switch to an
HTTPS host like https://api.example.com/:path*), and make the target
configurable via an environment variable (referenced conceptually as
VITE_BE1_BASE_URL) so production/staging can differ; locate the "destination"
entries in vercel.json and replace the HTTP IP values with an HTTPS domain
reference that will be supplied via env var.
- Around line 2-11: The production deployment is bypassing vercel.json rewrites
because apiConfig.ts returns absolute URLs from VITE_BE1_BASE_URL and
VITE_BE3_BASE_URL (per .env.example), so axios calls go directly to the backend;
fix by either (A) configuring production env vars VITE_BE1_BASE_URL and
VITE_BE3_BASE_URL to use the relative base paths "/be1" and "/be3" so
apiConfig.ts continues to return those relative paths and Vercel rewrites in
vercel.json apply, or (B) remove/disable vercel.json rewrites and update
documentation/.env.example to require absolute backend URLs for direct access;
update apiConfig.ts behavior and .env.example accordingly to keep the chosen
approach consistent.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 5b083c45-65bb-4b5e-8dcb-7c061ff33a24

📥 Commits

Reviewing files that changed from the base of the PR and between fd67d24 and a4b565a.

📒 Files selected for processing (1)
  • vercel.json

Comment thread vercel.json
Comment thread vercel.json Outdated
"rewrites": [
{
"source": "/be1/:path*",
"destination": "http://34.64.182.89:8081/:path*"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🌐 Web query:

Vercel rewrites에서 외부 destination으로 HTTP(비TLS) 사용 시 권장/제약 사항이 무엇인지, 그리고 프로덕션에서 HTTPS 사용 권장 근거를 공식 문서 기준으로 확인해줘.

💡 Result:

Vercel rewrites에서 외부 destination으로 HTTP(비TLS) 사용 시 공식 문서상 명시적인 제약이나 금지는 없으나, 모든 예시와 설명에서 https://를 사용하며 HTTP는 권장되지 않습니다. 프로덕션에서 HTTPS 사용이 강력히 권장되며, 이는 보안(데이터 암호화, MITM 방지), 성능(CDN 캐싱 지원), 표준 준수 이유입니다. 권장/제약 사항: - 공식 문서(https://vercel.com/docs/routing/rewrites, https://vercel.com/docs/project-configuration/vercel-json)에서 external rewrites 예시는 항상 "https://api.example.com" 형식. HTTP 예시 없음. - Next.js rewrites 등 프레임워크별에서도 HTTPS만 예시. Self-signed HTTPS는 dev에서 cert 오류 발생하나 프로덕션에서는 유효 cert 필요. - HTTP destination 지원 여부 명시 안 됨. 테스트 필요하나, 보안 정책상 프로덕션에서 HTTP 차단될 가능성 높음 (TLS 1.2/1.3만 지원, 모든 배포 HTTPS 강제). - 캐싱: External rewrites에서 upstream cache-control 존중하나, 프로덕션 최적화 위해 HTTPS 필수. 프로덕션 HTTPS 권장 근거 (공식 문서 기준): - 보안: Vercel CDN이 reverse proxy 역할 시 데이터 암호화 필수. HTTP는 평문 노출 위험 (MITM, 데이터 유출). - 성능: External rewrites 캐싱 기본 활성화(2026-04-06 이후 프로젝트). HTTPS에서만 안정적 CDN 캐싱/최적화. - 표준: 모든 Vercel 도메인 자동 HTTPS/TLS 제공. Custom 도메인도 HTTPS 권장 (Redirects 문서: "Prioritize HTTPS"). Enterprise만 custom SSL. - 규정 준수: PCI DSS 등에서 HTTPS 필수. Bulk redirects/project rules에서도 external dest "https://" 예시. 결론: 프로덕션에서는 HTTP 대신 HTTPS 사용 필수. HTTP 시 연결 실패/보안 경고 발생 가능. Dev에서만 self-signed 허용 논의 중(Next.js issue).

Citations:


HTTP + 고정 IP는 Vercel rewrites의 프로덕션 환경에서 권장되지 않습니다. HTTPS 기반 도메인 엔드포인트로 변경하세요.

Line 5, Line 9의 destination이 HTTP 및 고정 공인 IP(34.64.182.89)로 설정되어 있습니다. Vercel 공식 문서에서 external rewrites 모든 예시는 HTTPS를 사용하며, HTTP는 프로덕션에서 다음 이유로 권장되지 않습니다:

  • 보안: TLS 암호화 없음으로 인한 MITM 공격 위험, 데이터 평문 노출
  • 성능: CDN 캐싱 및 최적화 미지원 (HTTPS 기반만 지원)
  • 운영 유연성: 고정 IP 하드코딩으로 스테이징/프로덕션 환경 분리 불가

HTTPS 도메인 기반으로 변경하고, 환경별 설정은 환경 변수(예: VITE_BE1_BASE_URL)를 활용하세요.

수정 예시
 {
   "rewrites": [
     {
       "source": "/be1/:path*",
-      "destination": "http://34.64.182.89:8081/:path*"
+      "destination": "https://be1-backend.example.com/:path*"
     },
     {
       "source": "/be3/:path*",
-      "destination": "http://34.64.182.89:8083/:path*"
+      "destination": "https://be3-backend.example.com/:path*"
     }
   ]
 }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@vercel.json` at line 5, The rewrite destination currently points to an HTTP
URL with a fixed public IP ("destination": "http://34.64.182.89:8081/:path*");
update it to use an HTTPS domain-based endpoint and remove the hardcoded IP
(e.g., switch to an HTTPS host like https://api.example.com/:path*), and make
the target configurable via an environment variable (referenced conceptually as
VITE_BE1_BASE_URL) so production/staging can differ; locate the "destination"
entries in vercel.json and replace the HTTP IP values with an HTTPS domain
reference that will be supplied via env var.

@kim-subsub
kim-subsub merged commit 771fa9b into develop Apr 24, 2026
8 checks passed
@kim-subsub
kim-subsub deleted the feat/27 branch April 24, 2026 09:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant