开发者社区> 问答> 正文

Nginx 如何把指定页面派发到指定tomcat,求助

Nginx 如何把指定页面派发到指定tomcat

upstream tomcat_server{ 
#ip_hash; 
server 192.168.1.100:8080 weight=3; 
server 192.168.1.101:8080; 如果是test.htm一定要101这个tomcat运行,那么下面的应该怎么写。 

} 

--------------------- 

location ~ \.(htm|jsp)?$ { 
  proxy_set_header Host $host; 
  proxy_set_header X-Forwarded-For $remote_addr; 
  proxy_pass http://tomcat_server; 
  } 

求大牛指教

展开
收起
落地花开啦 2016-03-25 17:04:11 1971 0
1 条回答
写回答
取消 提交回答
  • 喜欢技术,喜欢努力的人

    `location ~ test.htm$ {

       proxy_pass http://192.168.1.101:8080;

    }`
    或者
    proxy_pass http://192.168.1.101:8080;

    2019-07-17 19:14:44
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
《Nginx 代理系统常用手册》 立即下载
CentOS Nginx PHP JAVA 多语言镜像使用手 立即下载
CentOS Nginx PHP JAVA多语言镜像使用手册 立即下载