nginx 변수 포트 번호

nginx 변수 포트 번호

일반 사용자가 시작할 때는 포트 8080에서, 루트로 시작할 때는 포트 80에서 nginx 서버를 실행할 수 있기를 바랍니다. 구성 파일에서 또는 bash 스크립트를 사용하여 이를 어떻게 매개변수화할 수 있습니까?

답변1

명령줄을 통해 구성 파일을 제공하려면 명령줄 도움말을 확인하세요.

$ /usr/sbin/nginx -h
nginx version: nginx/1.2.1
Usage: nginx [-?hvVtq] [-s signal] [-c filename] [-p prefix] [-g directives]

Options:
  -?,-h         : this help
  -v            : show version and exit
  -V            : show version and configure options then exit
  -t            : test configuration and exit
  -q            : suppress non-error messages during configuration testing
  -s signal     : send signal to a master process: stop, quit, reopen, reload
  -p prefix     : set prefix path (default: /etc/nginx/)
  -c filename   : set configuration file (default: /etc/nginx/nginx.conf)
  -g directives : set global directives out of configuration file

어쩌면 당신은 여기서 옵션을 찾고 있을 수도 있습니다 -c.

관련 정보