Nginx 시작
Section titled “Nginx 시작”sudo systemctl start nginxNginx 시작 (systemd 없이 Linux 배포를 실행하는 경우)
Section titled “Nginx 시작 (systemd 없이 Linux 배포를 실행하는 경우)”sudo service nginx startNginx 중지
Section titled “Nginx 중지”sudo systemctl stop nginxsudo service nginx stopNginx 다시 시작
Section titled “Nginx 다시 시작”sudo systemctl restart nginxsudo service nginx restartNginx reroad (새 설정을 적용해야할 떄)
Section titled “Nginx reroad (새 설정을 적용해야할 떄)”sudo systemctl reload nginxsudo service nginx reloadNginx 구성 테스트
Section titled “Nginx 구성 테스트”설정 파일 혹은 실행에 문제가 있는지 테스트하기 위해 사용한다
sudo nginx -t
# nginx: the configuration file /etc/nginx/nginx.conf syntax is ok# nginx: configuration file /etc/nginx/nginx.conf test is successfulNginx 상태 보기
Section titled “Nginx 상태 보기”상세한 상태정보를 반환한다.
sudo systemctl status nginx
# nginx.service - A high performance web server and a reverse proxy server# Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)# Active: active (running) since Sun 2019-04-21 13:57:01 PDT; 5min ago# Docs: man:nginx(8)# Process: 4491 ExecStop=/sbin/start-stop-daemon --quiet --stop --retry QUIT/5 --pidfile /run/nginx.pid (code=exited, status=0/SUCCESS)# Process: 4502 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=0/SUCCESS)# Process: 4492 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)# Main PID: 4504 (nginx)# Tasks: 3 (limit: 2319)# CGroup: /system.slice/nginx.service# |-4504 nginx: master process /usr/sbin/nginx -g daemon on; master_process on;# |-4516 nginx: worker process# `-4517 nginx: worker process