Nginx common commands

Windows

View help information

Nginx -h

View nginx Version (lowercase V)

Nginx -v

In addition to version information, configuration parameter information (capital letter V) is also displayed

Nginx -V

Start nginx

start Nginx

Specify the profile to start nginx

start Nginx -c filename

Close nginx, stop nginx completely and orderly, and save relevant information

Nginx -s quit

Close nginx and stop nginx quickly. Relevant information may not be saved

Nginx -s stop

Reload nginx. When the configuration information is modified and the configuration needs to be reloaded, it is used

Nginx -s reload

Reopen the log file

Nginx -s reopen

Test whether the nginx configuration file is correct

Nginx -t -c filename

Linux

be careful

service firewalld start
# 重启
service firewalld restart
# 关闭
service firewalld stop
# 查看防火墙规则
firewall-cmd --list-all
# 查询端口是否开放
firewall-cmd --query-port=8080/tcp
# 开放80端口
firewall-cmd --permanent --add-port=80/tcp
# 移除端口
firewall-cmd --permanent --remove-port=8080/tcp

#重启防火墙(修改配置后要重启防火墙)
firewall-cmd --reload

# 参数解释
1、firwall-cmd:是Linux提供的操作firewall的一个工具;
2、--permanent:表示设置为持久;
3、--add-port:标识添加的端口;
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>