React,Node,JQuery,js
[React] Nginx 배포 시 하위 Route 에서 404 에러 날때
bryan.oh
2020. 4. 3. 21:32
반응형
React 개발 시 잘 됐는데 nginx 로 배포했는데 root index는 잘 나오는데
단순한 localhost/login 이런것도 404 로 나올 때
우선 봐야할 게 nginx.conf 에서 try_files 살펴봐야 합니다.
server {
listen 80;
localhost / {
root /app/build;
index index.html;
try_files $uri $uri/ /index.html;
}
}
저의 경우엔 try_files 설정만 넣으니까 잘되네요.
728x90
반응형