安装nginx
- yum install pcre-devel zlib-devel
- cd /tmp
- wget http://nginx.org/download/nginx-1.0.14.tar.gz
- tar xzf nginx-1.0.14.tar.gz
- cd nginx-1.0.14
- ./configure --prefix=/usr/local/nginx
- make && make install
在nginx.conf中的server区块中加入:
- location ~ \.(jsp|jspx|do){
- proxy_set_header Host $host;
- proxy_set_header X-Forwarded-For $remote_addr;
- proxy_pass http://127.0.0.1:8080;
- }
程序启动
- /usr/local/nginx/sbin/nginx
- /usr/local/tomcat/bin/startup.sh
更过信息请查看 tomcat教程 http://www.itchm.com/forum-50-1.html