nginx 作为代理服务器,需要代理多个项目的话配置如下:
- server {  
 -     listen       80;  
 -     server_name  localhost;  
 -   
 -     #charset koi8-r;  
 -     #access_log  /var/log/nginx/log/host.access.log  main;  
 -   
 -     location / {  
 -         root   /usr/local/tomcat/webapps/GW;  
 -         index  index.html index.htm;  
 -     }  
 -   
 -    location /HealthXX {  
 -         proxy_pass http://10.24.1xx.1xx:8080/HealthPlatform;  <span style="font-family: Arial, Helvetica, sans-serif;">(部署在tomcat上的web项目)</span>  
 -    }  
 -   
 -    location /SmartBankXX {  
 - <pre name="code" class="plain"> <span style="white-space:pre">  </span> proxy_pass http://10.24.1xx.1xx:8080/SmartXX   (部署在tomcat上的web项目)  
 
server {    listen       80;    server_name  localhost;    #charset koi8-r;    #access_log  /var/log/nginx/log/host.access.log  main;    location / {        root   /usr/local/tomcat/webapps/GW;        index  index.html index.htm;    }   location /HealthXX {        proxy_pass http://10.24.1xx.1xx:8080/HealthPlatform;  <span style="font-family: Arial, Helvetica, sans-serif;">(部署在tomcat上的web项目)</span>   }   location /SmartBankXX {<pre name="code" class="plain"> <span style="white-space:pre">  </span> proxy_pass http://10.24.1xx.1xx:8080/SmartXX   (部署在tomcat上的web项目) }
访问某个项目: http:// IP/HealthXX 即可