fix: correct backend API routing and remove conflicting stripPrefix #157
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.
๐ PR ํ์
๐ ์ค๋ช
Traefik์ stripPrefix ์ค์ ๊ณผ FastAPI์
/apiprefix๊ฐ ์ถฉ๋ํ์ฌํ๋ก ํธ์๋์์ API ํธ์ถ ์
/api/api/*๊ตฌ์กฐ๊ฐ ๋ฐ์ํ๊ณ ,Swagger ๋ฌธ์(
/docs,/redoc,/openapi.json) ๋ํ ํ๋ก ํธ๋ก ๋ผ์ฐํ ๋์ด 404๊ฐ ๋ฐ์ํ๋ ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ์ต๋๋ค.๋ณธ PR์ getcloser ์๋น์ค์ ๋์ผํ ๋ผ์ฐํ ํจํด์ผ๋ก ์ ๋ฆฌํ์ฌ
FastAPI prefix ์ ์ง + Traefik stripPrefix ์ ๊ฑฐ ๋ฐฉ์์ผ๋ก ์ ์ ๋ผ์ฐํ ๋๋๋ก ์กฐ์ ํ์ต๋๋ค.
์ฎ์ธ ์ด์
๐จ ์์ ๋ด์ฉ
servers=[{"url": "/api"}]์ ๊ฑฐํ์ฌ Swagger์์ ์๋ชป๋ ๋ฒ ์ด์ค ๊ฒฝ๋ก๊ฐ ์กํ๋ ๋ฌธ์ ํด๊ฒฐ/api,/docs,/redoc,/health,/openapi.json์ ์ฒด๋ฅผ backend๋ก ์ ๋ฌํ๋๋ก ํตํฉ/api/api/*๋ฌธ์ ํด๊ฒฐ๐ธ ์คํฌ๋ฆฐ์ท
๐งโ๐ป ํ ์คํธ ๊ฒฐ๊ณผ
https://<domain>/api/uploadโ ์ ์ ํธ์ถhttps://<domain>/docsโ ์ ์ ์ ๊ทผ/api/api/*ํํ๋ก ํธ์ถ๋์ง ์์๐ ์ฒดํฌ๋ฆฌ์คํธ