1.做http服務器,存放靜態資源
2.虛擬主機
配置多個server,這裏的listen和server_name相當於確定url,現在用的switchHosts模擬域名,如下圖,這就意味着nginx作爲虛擬主機,比如兩個server_name*兩個listen=4個url進入分別與之對應的location中
3.反向代理
添加 upstream name{
服務器地址;
服務器地址;
}
在location/{}中引入
4.郵件代理服務器(沒試過)
linux常用命令
sbin目錄下
./niginx 啓動
./nginx -s stop 關閉
./nginx -s reload 重載