nginx files and directories and some nginx commands

1. Files and Directories

/etc/nginx/

The /etc/nginx/ directory is the default configuration root for the NGINX server, where you can find configuration files that tell NGINX how to run.

/etc/nginx/nginx.conf

The /etc/nginx/nginx.conf file is the default configuration entry point used by the NGINX service. This configuration file is capable of setting global settings for worker processes, tuning, logging, loading of dynamic modules, and references to other NGINX configuration files. In a default configuration, the /etc/nginx/nginx.conf file includes the top-level http code block, the context, which provides all configuration files in the directories described below.

/etc/nginx/conf.d/

The /etc/nginx/conf.d/ directory contains the default HTTP server configuration files, and the files ending with .conf are included in the top-level http code block of the /etc/nginx/nginx.conf file. Best practice is to utilize include statements and organize the configuration in this way to keep the configuration files clean. In some package repositories this folder is named sites-enabled and the configuration files are linked to the site-available folder; this convention is no longer used.

/var/log/nginx/

The /var/log/nginx/ directory is the default log location for NGINX, where you can find an access.log file and error.log file. The access log contains entries for every request served by NGINX. If the debug module is enabled, the error log file contains error events and debug information.

Two.nginx command

nginx -h Displays the NGINX help menu.

nginx -v displays the NGINX version.

nginx -V displays the NGINX version, build information, and configuration parameters showing the modules built into the NGINX binary.

nginx -t Test the NGINX configuration.

nginx -T Tests the NGINX configuration and prints the verified configuration to the screen. This command is useful when calling for support.

nginx -s signal The -s flag sends a signal to the NGINX master process. You can send signals such as stop, quit, reload, and reopen. The stop signal stops the NGINX process immediately. The quit signal stops the NGINX process after completing the currently processing request. The reload signal reloads the configuration. The reopen signal instructs NGINX to reopen log files.

Guess you like

Origin blog.csdn.net/qq_52676760/article/details/129580752