SyntaxError: Cannot use import statement outside a module
nginx 500 internal server error
ERROR LOG: rewrite or internal redirection cycle
nginx가 URL 요청을 받아 실행할 파일을 지정해주는 문법인 try_files에서 무한 loop에 빠지는 것이다.
nginx 문법
location / {
root /home/ubuntu/MaeilMail/client/build;
index index.html;
try_files $uri $uri/ /index.html;
}
location /api {
proxy_pass <http://127.0.0.1:3001>;
}
try_files 문법에서 root dir 아래에 uri를 발견하지 못하여 index.html를 실행하였는데 nginx location / 문법으로 다시 들어와버리는 무한 loop가 발생한 것
해결 방법
nginx 404 not found error
nginx -t
명령을 실행해보자/home/ubuntu/…
일 것.nginx 403 Forbidden