π¦ chore: Netlify μ’ μμ± μ κ±°λ₯Ό μν NGINX μ€μ λ³κ²½ λ° FE CD μ€ν¬λ¦½νΈ μμ± #294
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
π μμ λ΄μ©
nginx.conf
μ€μ νμΌ μ΄λνλ‘μ νΈ λ΄μμ nginx μ€μ μ νκ³ , μ§κ΄μ μΌλ‘ κ΄λ¦¬ν μ μλλ‘ λ£¨νΈ λλ ν 리 λ΄μ nginx μ€μ νμΌμ λ§λ€μμ΅λλ€.
κ·Έ ν,
/etc/nginx
κ²½λ‘ λ΄μμ λ£¨νΈ λλ ν 리μ conf νμΌμ include μ²λ¦¬ ν΄ μ£Όμμ΅λλ€.index.html λ° vite μ μ λΉλ νμΌμ NGINXμμ λ°ννλλ‘ λ³κ²½
κΈ°μ‘΄μ Netlifyμμ λ°ννλ μ μ νμΌμ NGINXμμ λ°νν μ μλλ‘ λΌμ°ν μ²λ¦¬ ν΄λμμ΅λλ€.
/
λ£¨νΈ κ²½λ‘λ‘ λ€μ΄μ€λ μμ²λ€μ client/dist λ΄ νμΌλ€(index.html, css λ° λ€μν js νμΌλ€)μ λ°νν©λλ€.νμ¬ https://www.api.denamu.site/ κ²½λ‘λ‘ μ μν΄λ³΄μλ©΄, public-was μΈμ€ν΄μ€μμ FE μ μ νμΌλ€μ λ°νν΄μ£Όλ μνμμ νμΈνμ€ μ μμΌλ©°, React Route μμ μ μμ μΌλ‘ λμνλ κ²μ λ³΄μ€ μ μμ΅λλ€.
Client νμΌλ€μμ API μμ²μ μ¬μ©λλ baseURL λ³κ²½
Important
@jungmyunggi @junyeokk baseURL λ³κ²½ λ΄μ© νμΈνμκΈ° λ°λλλ€.
public-was μΈμ€ν΄μ€ μλ²λ‘ κ°λ μμ²μ κΈ°μ‘΄μ
A λ μ½λ
λ₯Ό νμ©ν΄api
prefixλ₯Ό ν΅ν΄ ꡬλΆν΄ νλ‘μλ₯Ό μ§νμ€μ΄μμ΅λλ€.λ³Έ PRμ΄ λ³ν©λλ©΄, FE μμ²μ public-wasμ μμνμμΌλ―λ‘ netlify λ‘ λ§€ννλ κ²½λ‘λ₯Ό μ κ±°ν μμ μ λλ€.
ClientμΈ‘ CD Actions μ€ν¬λ¦½νΈ μμ±
Client μΈ‘ μ½λμ μ λ°μ΄νΈκ° μμ μ,
npm run
컀맨λλ₯Ό ν΅ν΄ λ°°ν¬λ₯Ό μννλ Github Actions μ€ν¬λ¦½νΈλ₯Ό μμ±νμ΅λλ€.μΆν λ³κ²½ λ°©μ
ν μν©μμ CloudFlareλ₯Ό μ κ±°νκΈ° μν΄, SSLμΈμ¦μ,
denamu.site
DNS λΌμ°ν λ³κ²½ (νμ¬λ CloudFlareλ‘ μ€μ λμ΄ μμ§λ§, μ΄μ λ κ°λΉμ λ€μμλ²μμ λ€μ΄λ νΈλ‘ Public IPλ‘ κ°λλ‘ λ³κ²½ν΄μΌ ν©λλ€.) λ±μ μΆκ°μ μΈ μ²λ¦¬κ° νμν©λλ€.νμ¬ μ μ νμΌ μλΉ λ°©μμ κ²°κ΅ μλ²μ λΆνλ₯Ό μ£Όλ λ°©μμ΄κΈ°μ, μ‘°κΈ λ κ°μ ν μ¬μ§κ° μλ€κ³ μκ°ν©λλ€. (Object Storage νΉμ S3 μ¬μ©νκΈ°.) νλ μΌλ¨μ μ΄λ κ² κ°μ μ νμκ³ μ΄μΌκΈ°κ° λμλ κ²μΌλ‘ κΈ°μ΅ν΄ μ§νν΄λ³΄μμ΅λλ€. μ΄κ²¬ μμΌμλ©΄ νΈνκ² λ§μν΄μ£ΌμΈμ π