启动的可执行文件在usr/bin/
nginx
停止:nginx -s stop
暴力马上终止服务器
nginx -s quit
非暴力退出(等待当前操作结束后退出)
重新加载:
nginx -s reload
- 在nginx.conf中 去配置模块
location /auth{
root html;
index auth.html;
}
是将HTML文件放在html目录中,而这个就是 /usr/local/nginx 来找对应的index文件的。
请求的时候就是通过 101.200.225.204/auth.html 来打开静态网页.
如果用了cgi的话, 就可以直接使用指令来执行动态请求. 101.200.225.204/test
3.
main 代表整个配置文件
http 代表web请求
server代表一个web服务器
location 代表web服务器要处理的一个指令
- 注意,在配置文件中时,location是设置命令的(浏览器访问时)里面的 root 后面跟的是在 /usr/local/nginx 里面的索引目录,比如:里面有一个html目录,里面存放的都是html,
location /{
root html;
index index.html; #这里存放的是在上面的html根目录索引找到的应该是index.html
}
location /1 {
root filex;
index upload.html; #此时会去 /usr/local/nginx/filex 里面去寻找该html
}
nginx里面的目录就是可放在配置文件中的模块
6.