Nginx
配置文件
默认配置文件nginx.config
默认配置文件目录/usr/local/nginx/conf,/etc/nginx或/usr/local/etc/nginx
命令行
nginx -s stop停止nginx进程
nginx -s quit等待当前请求完成后停止nginx进程
nginx -s reload重新加载配置文件
nginx -s reopen重新开始日志文件
kill -s QUIT 1628发送QUIT信号给指定进程ID的进程
ps -ax | grep nginx列出所有运行中的nginx进程
配置文件结构
http与event指令位于主上下文中,server位于http中,location位于server中
http {
server {
}
}web server
匹配文件扩展名
proxy server
location匹配规则
location匹配规则首先按序匹配正则表达式,如果满足,则不再继续匹配。如果没有满足的正则表达式,则匹配前缀最长的location
Last updated
Was this helpful?