1. nginx다운로드
brew install nginx
2. 이렇게 nginx.conf가 어디 있는지 알수있음.
The default port has been set in /opt/homebrew/etc/nginx/nginx.conf to 8080 so that
nginx can run without sudo.
3. sudo nginx
localhost:8080 포트를 열수있음.
4. brew info nginx
nginx.conf가 어디 있는지 알수있음.
5. nginx 종료하기
sudo nginx -s quit
6. nginx.conf 에서 port를 8080 -> 80으로 변경해주었음.
7. pm2 설치 : sudo npm i -g pm2
8. pm2 start index.js 했더니 되었음..
9. pm2 list : 뭐가 pm2에서 돌아가고 있는지 알수있음.
10. nginx.conf를 이렇게 바꿔보았음
location / {
# root html;
# index index.html index.htm;
proxy_pass http://localhost:3000/;
}
11. 서버를 껐다 킴.
질문) nvm을 설치했는데 이게 대체 뭐냐..?
=> node버전관리해주는 거라고함.
'Node' 카테고리의 다른 글
토큰이 있어야 하는 라우터의 경우 postman에서 테스트하는 방법 (0) | 2022.10.31 |
---|---|
npm에 대한 개념, 특정버전 설치하기 (0) | 2022.10.28 |
dotenv 설치 및 사용하기 (0) | 2022.10.27 |
OSI 7계층의 Application Layer (0) | 2022.10.27 |
http모듈 개념 & 3000서버 만들어보기 (0) | 2022.10.22 |