1.重啓
[root@iZ25phahu3aZ nginx]# cd sbin/
[root@iZ25phahu3aZ sbin]# ls
nginx
[root@iZ25phahu3aZ sbin]# pwd
/usr/local/nginx/sbin
[root@iZ25phahu3aZ sbin]# ls
nginx
[root@iZ25phahu3aZ sbin]# ps -ef | grep nginx
root 20195 1 0 Dec16 ? 00:00:00 nginx: master process ./nginx
nobody 20196 20195 0 Dec16 ? 00:00:00 nginx: worker process
root 21697 21660 0 19:39 pts/0 00:00:00 grep nginx
[root@iZ25phahu3aZ sbin]# kill -QUIT 20195 20196
[root@iZ25phahu3aZ sbin]# ps -ef | grep nginx
root 21701 21660 0 19:40 pts/0 00:00:00 grep nginx
[root@iZ25phahu3aZ sbin]# ./nginx
[root@iZ25phahu3aZ sbin]# ps -ef | grep nginx
root 21703 1 0 19:41 ? 00:00:00 nginx: master process ./nginx
nobody 21704 21703 0 19:41 ? 00:00:00 nginx: worker process
root 21706 21660 0 19:41 pts/0 00:00:00 grep nginx
[root@iZ25phahu3aZ sbin]#
proxy_pass http://localhost:8080;
}
location ~* \.(gif|jpg|jpeg|png|css|js|ico|html)$ {
root /home/myapp/navi;
}
location / {
proxy_pass http://localhost:80;
}
第一個location意思是,嚴格匹配,如果是根uri就直接pass到resin,不管後面三個location。