본문 바로가기

Open Source/nginx

nginx 개요 및 설치

[1. 개요]

nginx 설치 및 간단한 사용 방법 정리


[2. 설치 - Windows]

nginx 설치 및 간단한 실행

윈도우 환경에서 start 없이 nginx 를 바로 실행하면 콘솔 창을 꺼도 프로세스가 죽지는 않는다.


[3. 기타 사용 방법]

따로 configuration 파일을 명시하지 않으면, conf/nginx.conf 를 default 설정 파일로 사용한다.

 

=> 설정 파일 체크

  • nginx -t 
    # default 설정 파일을 확인한다.
  • nginx -t   -c  "확인 할 설정파일 경로"
    # 지정한 설정 파일을 확인한다.

=> nginx 실행

  • nginx
    # default 설정 파일을 이용하여 nginx 실행
  • nginx -c "설정파일 경로"
    # 지정한 설정 파일을 이용하여 nginx 를 실행

=> nginx 종료

  • nginx -s stop
    # fast shutdown
  • nginx -s quit
    # graceful shutdown
  • nginx -s reopen
    # reoping the log files
    # log file 을 nginx 가 계속 소유하는 것이 아님
    # 기존 log file 을 다른 곳으로 옮기고, reopen 하면 로그 파일이 다시 생김. 
  • nginx -s reload
    # reloading config file