重啓 ./nginx -s reload
service nginx restart
server {
listen 80;server_name www.****.org ;
location / { // 以/ 開頭的
root /usr/src/web/www/WebContent/page;
index index.jsp index.htm;
proxy_pass http://www..****..org:8001;//轉向的地址
}
location = / { //等於
proxy_pass http://www.****org/home/index;
}
location ~* \.(txt|doc)$ {
root /usr/src/web/www;
deny all; //禁止訪問
}
}
server {
listen 80;
server_name cms..****..org ;
location / {
proxy_pass http://cms..****..org:8002; //轉向的地址
}
location ~* \.(txt|doc)$ {
root /usr/src/web/cms;
deny all;
}
}
tomcat 地址重寫
<Context docBase="D:\work\apache-tomcat-7.0.52\webapps\****" path="/*****" reloadable="true" />