← 返回命令列表

Linux command

nginx 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Start nginx

nginx

Test configuration

nginx -t

Reload configuration

nginx -s reload

Stop nginx

nginx -s stop

Graceful shutdown

nginx -s quit

Show version

nginx -v

Use specific config

nginx -c [/etc/nginx/nginx.conf]

Prefix path

nginx -p [/var/www]

说明

nginx is a web server and reverse proxy. It handles HTTP, HTTPS, and mail proxy. The tool serves static content. Supports load balancing and caching.

参数

-t
Test configuration.
-s _SIGNAL_
Send signal (stop, quit, reload, reopen).
-c _FILE_
Configuration file.
-v
Show version.
-V
Show version and config.
-p _PATH_
Prefix path.
--help
Display help information.

FAQ

What is the nginx command used for?

nginx is a web server and reverse proxy. It handles HTTP, HTTPS, and mail proxy. The tool serves static content. Supports load balancing and caching.

How do I run a basic nginx example?

Run `nginx` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -t do in nginx?

Test configuration.