Nginx Basics: Difference between revisions

From WikiMLT
Line 19: Line 19:
   -c filename  : set configuration file (default: /etc/nginx/nginx.conf)
   -c filename  : set configuration file (default: /etc/nginx/nginx.conf)
   -g directives : set global directives out of configuration file
   -g directives : set global directives out of configuration file
</syntaxhighlight>Control via <code>systemctl</code>.<syntaxhighlight lang="shell" line="1">
</syntaxhighlight>
 
Control via <code>systemctl</code>.
 
<syntaxhighlight lang="shell" line="1" class="code-continue">
sudo systemctl start nginx.service
sudo systemctl start nginx.service
 
</syntaxhighlight>
</syntaxhighlight><syntaxhighlight lang="shell" line="1">
<syntaxhighlight lang="shell" line="1" class="code-continue mlw-shell-gray">
sudo systemctl stop nginx.service
sudo systemctl stop nginx.service
 
</syntaxhighlight>
</syntaxhighlight><syntaxhighlight lang="shell" line="1">
<syntaxhighlight lang="shell" line="1" class="code-continue">
sudo systemctl reload nginx.service
sudo systemctl reload nginx.service
 
</syntaxhighlight>
</syntaxhighlight><syntaxhighlight lang="shell" line="1">
<syntaxhighlight lang="shell" line="1" class="code-continue mlw-shell-gray">
sudo systemctl restart nginx.service
sudo systemctl restart nginx.service
</syntaxhighlight>
</syntaxhighlight>



Revision as of 10:38, 18 February 2023

CLI

sudo nginx -h
nginx version: nginx/1.18.0 (Ubuntu)
Usage: nginx [-?hvVtTq] [-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
  -T            : test configuration, dump it 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: /usr/share/nginx/)
  -c filename   : set configuration file (default: /etc/nginx/nginx.conf)
  -g directives : set global directives out of configuration file

Con­trol via sys­tem­ctl.

sudo systemctl start nginx.service
sudo systemctl stop nginx.service
sudo systemctl reload nginx.service
sudo systemctl restart nginx.service

Ref­er­ences