nginx

2020. 8. 3. 20:55카테고리 없음

//nginx 서버 상태

systemctl status nginx

// 서버키기 

sudo systemctl start nginx

// 서버 중지 

sudo systemctl stop nginx

// 서버 재시작

sudo systemctl restart nginx

 

만약 아래와 같이 시작이 안된다.

Failed to start A high performance web server and a reverse proxy server.

원인은 대부분 conf.d 폴더안의 default.conf 파일에 문제가 있어서다.

-> error 로그 보고 하나씩 주석 처리해가며 원인을 파악하자!

 

  https://brunch.co.kr/@springboot/188 

npm run build 로 배포 

배포하면 dist 폴더에 생김 (css,html ,js 등) 

 

nginx 의 conf.d 폴더안에 vuejs.conf 파일안에 

root 경로에 dist 폴더를 넣어준다. (또는 복사해서 var/www/html/dist) 에 넣어준다.

(~/test/s03~/frontend 에서 )

sudo cp -r dist/ /var/www/html/

 

nginx 관련 명령어출처: https://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-ubuntu-16-04