Detailed explanation of basic operation commands such as starting and stopping Nginx under Windows

Detailed explanation of basic operation commands such as starting and stopping Nginx under Windows

To use Nginx under Windows, we need to master some basic operation commands, such as: starting, stopping Nginx service, reloading Nginx, etc. Below I will give some brief introductions.

1. Startup:

C:\server\nginx-1.0.2>start nginx

or

C:\server\nginx-1.0.2>nginx.exe

Note: It is recommended to use the first method. The second method will keep your cmd window in execution and prevent you from performing other command operations.

2. Stop:

C:\server\nginx-1.0.2>nginx.exe -s stop

or

C:\server\nginx-1.0.2>nginx.exe -s quit

Note: stop stops nginx quickly and may not save relevant information; quit stops nginx completely and orderly and saves relevant information.

3. Reload Nginx:

C:\server\nginx-1.0.2>nginx.exe -s reload

This command is used when the configuration information is modified and needs to be reloaded.

4. Reopen the log file:

C:\server\nginx-1.0.2>nginx.exe -s reopen

5. Check the Nginx version:

C:\server\nginx-1.0.2>nginx -v

nginx: nginx version: nginx/1.0.2

or

C:\server\nginx-1.0.2>nginx -V

nginx: nginx version: nginx/1.0.2 
nginx: TLS SNI support enabled 
nginx: configure arguments: --builddir=objs.msvc8 --crossbuild=win32 --with-debug --prefix= --conf-path=conf/nginx.conf --pid-path=logs/nginx.pid --http-log-path=logs/access.log --error-log-path=logs/error.log --sbin-path=nginx.exe --http-client-body-temp-path=temp/client_body_temp --http-proxy-temp-path=temp/proxy_temp --http-fastcgi-temp-path=temp/fastcgi_temp --with-cc-opt=-DFD_SETSIZE=1024 --with-pcre=objs.msvc8/lib/pcre-7.9 --with-zlib=objs.msvc8/lib/zlib-1.2.3 --with-select_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-http_stub_status_module --with-http_flv_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-mail --with-ipv6 --with-openssl=objs.msvc8/lib/openssl-0.9.8r --with-openssl-opt=enable-tlsext --with-http_ssl_module --with-mail_ssl_module

Note: v simply displays the version information, while V not only displays the version information but also the configuration parameter information.

6. Test or load the specified configuration file:

Test Configuration File

C:\server\nginx-1.0.2>nginx.exe -t -c conf/default.conf

nginx: the configuration file C:\server\nginx-1.0.2/conf/default.conf syntax isok
nginx: configuration file C:\server\nginx-1.0.2/conf/default.conf test is successful

Load the specified configuration file

C:\server\nginx-1.0.2>start nginx.exe -c conf/default.conf

The commands introduced in this article are very basic. It takes a lot of space to remember them. Just try them a few more times.

You may also be interested in:
  • Configure Nginx+PHP basic operations under Windows (start, restart and exit)
  • How to shut down/restart/start nginx

<<:  Detailed explanation of how to enable slow query log in MySQL database

>>:  Example steps for implementing class selectors and name attribute selectors in js

Recommend

Website background music implementation method

For individual webmasters, how to make their websi...

How to fix the footer at the bottom of the page (multiple methods)

As a front-end Web engineer, you must have encoun...

How to make a div height adaptive to the browser height

This old question has troubled countless front-end...

Introduction and use of five controllers in K8S

Table of contents Controller type of k8s Relation...

Detailed steps for creating a Vue scaffolding project

vue scaffolding -> vue.cli Quickly create a la...

Detailed tutorial on installing Docker and docker-compose suite on Windows

Table of contents Introduction Download and insta...

Tutorial on installing mysql5.7.36 database in Linux environment

Download address: https://dev.mysql.com/downloads...

Example code for using @media in CSS3 to achieve web page adaptation

Nowadays, the screen resolution of computer monit...

Summary of MySQL data migration

Table of contents Preface: 1. About data migratio...

HTML table tag tutorial (11): horizontal alignment attribute ALIGN

In the horizontal direction, you can set the alig...

How to set up vscode remote connection to server docker container

Table of contents Pull the image Run the image (g...

MySQL cursor principle and usage example analysis

This article uses examples to explain the princip...

Vue uses vue meta info to set the title and meta information of each page

title: vue uses vue-meta-info to set the title an...

Vue implementation example using Google Recaptcha verification

In our recent project, we need to use Google robo...