Nginx+tomcat整合安装配置

安装nginx

  1. yum install pcre-devel zlib-devel
  2. cd /tmp
  3. wget http://nginx.org/download/nginx-1.0.14.tar.gz
  4. tar xzf nginx-1.0.14.tar.gz
  5. cd nginx-1.0.14
  6. ./configure --prefix=/usr/local/nginx
  7. make && make install

在nginx.conf中的server区块中加入:

  1. location ~ \.(jsp|jspx|do){
  2.             proxy_set_header Host $host;
  3.             proxy_set_header X-Forwarded-For $remote_addr;
  4.             proxy_pass http://127.0.0.1:8080;
  5.         }

程序启动

  1. /usr/local/nginx/sbin/nginx
  2. /usr/local/tomcat/bin/startup.sh


更过信息请查看 tomcat教程 http://www.itchm.com/forum-50-1.html

你可能感兴趣的:(java,tomcat,nginx,header,jsp,server)