게시글
질문&답변
Google login 및 axios 문의
1번도 관련 내용은 찾아서 억지로 해결은 했는데 약간 문제가 있네요.https://stackoverflow.com/questions/59888240/next-js-server-side-api-call-returns-500-internal-server-errorlocalhost를 nginx 컨테이너의 ip로 하드코딩해서 변경했더니 되는데. 매번 생성시마다 ip는 고정되지 않고 변경되어서 수정해야하는 문제가 있습니다. 도와주세요~
- 0
- 3
- 385
질문&답변
Google login 및 axios 문의
2번은 해결 했습니다. 패스포트에서 콜백이 기존"/api/auth/google/callback" 였는데 로컬호스트를 붙였더니 "http://localhost:3000/api/auth/google/callback" 해결됐네요. 왜 이렇게 되는건지는 여전히 잘 모르겠네요ㅠ 앞에 경로를 제외하면 왜 localhost:3000이 아닌고 http://backend 인걸까요? 그럼 프론트엔드에서도 요청이 nginx가 아니고 http://frontend로 가야할 것 같은데..
- 0
- 3
- 385
질문&답변
Google login 및 axios 문의
nginx 설정은 강의와 같게 하고 있습니다. # frontend : docker-compose 파일에서 사용할 이름 upstream frontend { server frontend:3005; } # backend : docker-compose 파일에서 사용할 이름 upstream backend { server backend:3000; } server { listen 80; location / { proxy_pass http://frontend; } location /api { proxy_pass http://backend; } location /sockjs-node { # 리액트 개발환경 에러 처리를 위한 코드 proxy_pass http://frontend; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "Upgrade"; } }
- 0
- 3
- 385