IIRF反向代理问题

发布于 2024-08-19 20:48:35 字数 10408 浏览 9 评论 0原文

我们有一个 Java 应用程序 (Atlassian Bamboo) 在 Windows 2003 上的端口 8085 上运行。可以通过 http://bamboo:8085 进行访问。

我正在尝试使用 IIRF 为 IIS6 设置反向代理,以便可以通过
访问内容 http://bamboo. 看来我设置的ip正确,并且我可以检索状态页面。 这就是我的 IIRF.ini 的样子:

RewriteLog c:\temp\iirf  
RewriteLogLevel 2
StatusUrl /iirfStatus  
RewriteCond %{HTTP_HOST}   ^bambooi$  [I]  
#This setup works
#ProxyPass ^/(.*)$          http://othersite/$1  
#This does not  
ProxyPass ^/(.*)$          http://bamboo:8085/$1  

但是,当我在 IE 中输入 http://bamboo 时,我收到“页面无法显示”消息。 FF 根本不返回任何内容。 我制作了 Wireshark 网络转储,选择“跟随 TCPstream”,似乎正在检索正确的页面。为什么我看不到它?

我还注意到我可以检索 http://bamboo/favicon.ico 所以我一定非常接近解决方案。 这是 Wireshark 的输出:

GET / HTTP/1.1
Accept: image/gif, image/jpeg, image/pjpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-ms-application, application/x-ms-xbap, application/vnd.ms-xpsdocument, application/xaml+xml, */*
Accept-Language: en-gb
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
Accept-Encoding: gzip, deflate
Host: bamboo
Connection: Keep-Alive
Cookie: JSESSIONID=wpsse0zyo4g5

HTTP/1.1 200 200 OK
Date: Sat, 30 Jan 2010 09:19:46 GMT
Server: Microsoft-IIS/6.0
Via: 1.1 DESTINATION_IP (IIRF 2.0)
Content-Type: text/html; charset=utf-8
Transfer-Encoding: chunked

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Dashboard</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta name="robots" content="all" />
<meta name="MSSmartTagsPreventParsing" content="true" />

<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="-1" />

<link type="text/css" rel="stylesheet" href="/s/1206/1/_/scripts/yui-2.6.0/build/grids/grids.css" />
<!--<link type="text/css" rel="stylesheet" href="/s/1206/1/_/scripts/yui/build/reset-fonts-grids/reset-fonts-grids.css" />-->
<link rel="stylesheet" href="/s/1206/1/_/styles/main.css" type="text/css" />
<link rel="stylesheet" href="/s/1206/1/_/styles/main2.css" type="text/css" />
<link rel="stylesheet" href="/s/1206/1/_/styles/global-static.css" type="text/css" />
<link rel="stylesheet" href="/s/1206/1/_/styles/widePlanList.css" type="text/css" />
<link rel="stylesheet" href="/s/1206/1/_/styles/forms.css" type="text/css" />
<link rel="stylesheet" href="/s/1206/1/_/styles/yui-support/yui-custom.css" type="text/css" />
<link rel="shortcut icon" href="/s/1206/1/_/images/icons/favicon.ico" type="image/x-icon"/>
<link rel="icon" href="/s/1206/1/_/images/icons/favicon.png" type="image/png" />
<link rel="stylesheet" href="/s/1206/1/_/styles/bamboo-tabs.css" type="text/css" />

<!-- Core YUI-->
<link rel="stylesheet" type="text/css" href="/s/1206/1/_/scripts/yui-2.6.0/build/tabview/assets/tabview-core.css">
<link rel="stylesheet" type="text/css" href="/s/1206/1/_/scripts/yui-2.6.0/build/tabview/assets/skins/sam/tabview-skin.css">

<script type="text/javascript"          src="/s/1206/1/_/scripts/yui-2.6.0/build/yahoo/yahoo-min.js"></script>
<script type="text/javascript"          src="/s/1206/1/_/scripts/yui-2.6.0/build/event/event-min.js" ></script>
<script type="text/javascript"          src="/s/1206/1/_/scripts/yui-2.6.0/build/dom/dom-min.js" ></script>
<!--<script type="text/javascript"          src="/s/1206/1/_/scripts/yui-2.6.0/build/animation/animation.js" ></script>-->

<!-- Container -->
<script type="text/javascript"          src="/s/1206/1/_/scripts/yui-2.6.0/build/container/container-min.js"></script>
<script type="text/javascript"          src="/s/1206/1/_/scripts/yui-2.6.0/build/connection/connection-min.js"></script>
<link type="text/css" rel="stylesheet" href="/s/1206/1/_/scripts/yui-2.6.0/build/container/assets/container.css" />

<!-- Menu -->
<script type="text/javascript"          src="/s/1206/1/_/scripts/yui-2.6.0/build/menu/menu-min.js"></script>
<link type="text/css" rel="stylesheet" href="/s/1206/1/_/scripts/yui-2.6.0/build/menu/assets/menu.css" />

<!-- Tab view -->
<!-- JavaScript Dependencies for Tabview: -->
<script type="text/javascript"          src="/s/1206/1/_/scripts/yui-2.6.0/build/yahoo-dom-event/yahoo-dom-event.js"></script>
<script type="text/javascript"          src="/s/1206/1/_/scripts/yui-2.6.0/build/element/element-beta-min.js"></script>
<!-- Needed for old versions of the YUI -->
<link rel="stylesheet" href="/s/1206/1/_/styles/yui-support/tabview.css" type="text/css" />
<link rel="stylesheet" href="/s/1206/1/_/styles/yui-support/round_tabs.css" type="text/css" />

<script type="text/javascript"          src="/s/1206/1/_/scripts/yui-2.6.0/build/tabview/tabview-min.js"></script>

<script type="text/javascript"          src="/s/1206/1/_/scripts/yui-2.6.0/build/json/json-min.js"></script>
<script type="text/javascript" src="/s/1206/1/_/scripts/yui-ext/yui-ext-nogrid.js"></script>

<script type="text/javascript" src="/s/1206/1/_/scripts/bamboo.js"></script>

<script type="text/javascript">
    YAHOO.namespace('bamboo');
    YAHOO.bamboo.tooltips = new Object();
    YAHOO.bamboo.contextPath = '';
    YAHOO.ext.UpdateManager.defaults.loadScripts = true;
    YAHOO.ext.UpdateManager.defaults.indicatorText = '<div class="loading-indicator">Currently loading...</div>';
    YAHOO.ext.UpdateManager.defaults.timeout = 60;
    addUniversalOnload(addConfirmationToLinks);
</script>
<link rel="alternate" type="application/rss+xml" title="Bamboo RSS feed" href="/rss/createAllBuildsRssFeed.action?feedType=rssAll" />
</head>
<body>
<ul id="top">
<li id="skipNav">
    <a href="#menu">Skip to navigation</a>
</li>
<li>
    <a href="#content">Skip to content</a>
</li>
</ul>
<div id="nonFooter">

<div id="hd">

<div id="header">
<div id="logo">
    <a href="/start.action"><img src="/images/bamboo_header_logo.gif" alt="Atlassian Bamboo" height="36" width="118" /></a>
</div>
<ul id="userOptions">
    <li id="loginLink">
        <a id="login" href="/userlogin!default.action?os_destination=%2Fstart.action">Log in</a>
    </li>
        <li id="signupLink">
            <a id="signup" href="/signupUser!default.action">Signup</a>
        </li>
    <li id="helpLink">
        <a id="help" href="http://confluence.atlassian.com/display/BAMBOO">Help</a>
    </li>
</ul>
</div> <!-- END #header -->

<div id="menu">
<ul>
    <li><a id="home" href="/start.action" title="Atlassian Bamboo" accesskey="H">  <u>H</u>ome</a></li>
    <li><a id="authors" href="/authors/gotoAuthorReport.action" accesskey="U">A<u>u</u>thors</a></li>
    <li><a id="reports" href="/reports/viewReport.action" accesskey="R"> <u>R</u>eports</a></li>
</ul>
</div> <!-- END #menu -->
</div> <!-- END #hd -->
<div id="bd">
<div id="content">
<h1>Header here</h1>
<div class="topMarginned">
        <div id='buildSummaryTabs' class='dashboardTab'>
        </div>
    <script type="text/javascript">
        function initUI(){
            var jtabs = new YAHOO.ext.TabPanel('buildSummaryTabs');
            YAHOO.bamboo.tabPanel = jtabs;


            // Use setUrl for Ajax loading
            var tab3 = jtabs.addTab('allTab', "All Plans");
            tab3.setUrl('/ajax/displayAllBuildSummaries.action', null, true);

            var tab4 = jtabs.addTab("currentTab", "Current Activity");
            tab4.setUrl('/ajax/displayCurrentActivity.action', null, true);


            var handleTabChange = function(e, activePanel) {
                saveCookie('atlassian.bamboo.dashboard.tab.selected', activePanel.id, 365);
            };

            jtabs.on('tabchange', handleTabChange);

            var selectedCookie = getCookieValue('atlassian.bamboo.dashboard.tab.selected');
            if (jtabs.getTab(selectedCookie))
            {
                jtabs.activate(selectedCookie);
            }
            else
            {
                jtabs.activate('allTab');
            }
        }
        YAHOO.util.Event.onContentReady('buildSummaryTabs', initUI);
    </script>
</div>

<script type="text/javascript">
setTimeout( "window.location.reload()", 1800*1000 );
</script>
<div class="clearer" ></div>      
</div> <!-- END #content -->
</div> <!-- END #bd -->  
</div> <!-- END #nonFooter -->
<div id="ft">
    <div id="footer">
        <p>
            Powered by <a href="http://www.atlassian.com/software/bamboo/">Atlassian Bamboo</a> version 2.2.1 build 1206 -

            <span title="15:59:44 17 Mar 2009">17 Mar 09</span>
        </p>
        <ul>
            <li class="first">
                <a href="https://support.atlassian.com/secure/CreateIssue.jspa?pid=10060&issuetype=1">Report a problem</a>
            </li>
            <li>
                <a href="http://jira.atlassian.com/secure/CreateIssue.jspa?pid=11011&issuetype=4">Request a feature</a>
            </li>
            <li>
                <a href="http://forums.atlassian.com/forum.jspa?forumID=103">Contact Atlassian</a>
            </li>
            <li>
                <a href="/viewAdministrators.action">Contact Administrators</a>
            </li>
        </ul>
    </div> <!-- END #footer -->
</div> <!-- END #ft -->

We have a java application ( Atlassian Bamboo) running on port 8085 on Windows 2003. It is accessile as http: //bamboo:8085.

I am trying to setup reverse proxy for IIS6 using IIRF so content is accessible via
http: //bamboo.
It seems that I set it ip correctly, and I can retrieve Status page.
This is how my IIRF.ini looks like:

RewriteLog c:\temp\iirf  
RewriteLogLevel 2
StatusUrl /iirfStatus  
RewriteCond %{HTTP_HOST}   ^bambooi$  [I]  
#This setup works
#ProxyPass ^/(.*)$          http://othersite/$1  
#This does not  
ProxyPass ^/(.*)$          http://bamboo:8085/$1  

However when I type in http: //bamboo in IE, I get 'page cannot be displayed ' message.
FF does not return anything at all.
I made Wireshark network dump, selected 'follow TCPstream' and it seems like correct page is being retrieved.Why cannot I see it then?

I also noticed that I can retrieve http: //bamboo/favicon.ico so I must be very close to the solution..
This is the Wireshark output:

GET / HTTP/1.1
Accept: image/gif, image/jpeg, image/pjpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-ms-application, application/x-ms-xbap, application/vnd.ms-xpsdocument, application/xaml+xml, */*
Accept-Language: en-gb
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
Accept-Encoding: gzip, deflate
Host: bamboo
Connection: Keep-Alive
Cookie: JSESSIONID=wpsse0zyo4g5

HTTP/1.1 200 200 OK
Date: Sat, 30 Jan 2010 09:19:46 GMT
Server: Microsoft-IIS/6.0
Via: 1.1 DESTINATION_IP (IIRF 2.0)
Content-Type: text/html; charset=utf-8
Transfer-Encoding: chunked

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Dashboard</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta name="robots" content="all" />
<meta name="MSSmartTagsPreventParsing" content="true" />

<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="-1" />

<link type="text/css" rel="stylesheet" href="/s/1206/1/_/scripts/yui-2.6.0/build/grids/grids.css" />
<!--<link type="text/css" rel="stylesheet" href="/s/1206/1/_/scripts/yui/build/reset-fonts-grids/reset-fonts-grids.css" />-->
<link rel="stylesheet" href="/s/1206/1/_/styles/main.css" type="text/css" />
<link rel="stylesheet" href="/s/1206/1/_/styles/main2.css" type="text/css" />
<link rel="stylesheet" href="/s/1206/1/_/styles/global-static.css" type="text/css" />
<link rel="stylesheet" href="/s/1206/1/_/styles/widePlanList.css" type="text/css" />
<link rel="stylesheet" href="/s/1206/1/_/styles/forms.css" type="text/css" />
<link rel="stylesheet" href="/s/1206/1/_/styles/yui-support/yui-custom.css" type="text/css" />
<link rel="shortcut icon" href="/s/1206/1/_/images/icons/favicon.ico" type="image/x-icon"/>
<link rel="icon" href="/s/1206/1/_/images/icons/favicon.png" type="image/png" />
<link rel="stylesheet" href="/s/1206/1/_/styles/bamboo-tabs.css" type="text/css" />

<!-- Core YUI-->
<link rel="stylesheet" type="text/css" href="/s/1206/1/_/scripts/yui-2.6.0/build/tabview/assets/tabview-core.css">
<link rel="stylesheet" type="text/css" href="/s/1206/1/_/scripts/yui-2.6.0/build/tabview/assets/skins/sam/tabview-skin.css">

<script type="text/javascript"          src="/s/1206/1/_/scripts/yui-2.6.0/build/yahoo/yahoo-min.js"></script>
<script type="text/javascript"          src="/s/1206/1/_/scripts/yui-2.6.0/build/event/event-min.js" ></script>
<script type="text/javascript"          src="/s/1206/1/_/scripts/yui-2.6.0/build/dom/dom-min.js" ></script>
<!--<script type="text/javascript"          src="/s/1206/1/_/scripts/yui-2.6.0/build/animation/animation.js" ></script>-->

<!-- Container -->
<script type="text/javascript"          src="/s/1206/1/_/scripts/yui-2.6.0/build/container/container-min.js"></script>
<script type="text/javascript"          src="/s/1206/1/_/scripts/yui-2.6.0/build/connection/connection-min.js"></script>
<link type="text/css" rel="stylesheet" href="/s/1206/1/_/scripts/yui-2.6.0/build/container/assets/container.css" />

<!-- Menu -->
<script type="text/javascript"          src="/s/1206/1/_/scripts/yui-2.6.0/build/menu/menu-min.js"></script>
<link type="text/css" rel="stylesheet" href="/s/1206/1/_/scripts/yui-2.6.0/build/menu/assets/menu.css" />

<!-- Tab view -->
<!-- JavaScript Dependencies for Tabview: -->
<script type="text/javascript"          src="/s/1206/1/_/scripts/yui-2.6.0/build/yahoo-dom-event/yahoo-dom-event.js"></script>
<script type="text/javascript"          src="/s/1206/1/_/scripts/yui-2.6.0/build/element/element-beta-min.js"></script>
<!-- Needed for old versions of the YUI -->
<link rel="stylesheet" href="/s/1206/1/_/styles/yui-support/tabview.css" type="text/css" />
<link rel="stylesheet" href="/s/1206/1/_/styles/yui-support/round_tabs.css" type="text/css" />

<script type="text/javascript"          src="/s/1206/1/_/scripts/yui-2.6.0/build/tabview/tabview-min.js"></script>

<script type="text/javascript"          src="/s/1206/1/_/scripts/yui-2.6.0/build/json/json-min.js"></script>
<script type="text/javascript" src="/s/1206/1/_/scripts/yui-ext/yui-ext-nogrid.js"></script>

<script type="text/javascript" src="/s/1206/1/_/scripts/bamboo.js"></script>

<script type="text/javascript">
    YAHOO.namespace('bamboo');
    YAHOO.bamboo.tooltips = new Object();
    YAHOO.bamboo.contextPath = '';
    YAHOO.ext.UpdateManager.defaults.loadScripts = true;
    YAHOO.ext.UpdateManager.defaults.indicatorText = '<div class="loading-indicator">Currently loading...</div>';
    YAHOO.ext.UpdateManager.defaults.timeout = 60;
    addUniversalOnload(addConfirmationToLinks);
</script>
<link rel="alternate" type="application/rss+xml" title="Bamboo RSS feed" href="/rss/createAllBuildsRssFeed.action?feedType=rssAll" />
</head>
<body>
<ul id="top">
<li id="skipNav">
    <a href="#menu">Skip to navigation</a>
</li>
<li>
    <a href="#content">Skip to content</a>
</li>
</ul>
<div id="nonFooter">

<div id="hd">

<div id="header">
<div id="logo">
    <a href="/start.action"><img src="/images/bamboo_header_logo.gif" alt="Atlassian Bamboo" height="36" width="118" /></a>
</div>
<ul id="userOptions">
    <li id="loginLink">
        <a id="login" href="/userlogin!default.action?os_destination=%2Fstart.action">Log in</a>
    </li>
        <li id="signupLink">
            <a id="signup" href="/signupUser!default.action">Signup</a>
        </li>
    <li id="helpLink">
        <a id="help" href="http://confluence.atlassian.com/display/BAMBOO">Help</a>
    </li>
</ul>
</div> <!-- END #header -->

<div id="menu">
<ul>
    <li><a id="home" href="/start.action" title="Atlassian Bamboo" accesskey="H">  <u>H</u>ome</a></li>
    <li><a id="authors" href="/authors/gotoAuthorReport.action" accesskey="U">A<u>u</u>thors</a></li>
    <li><a id="reports" href="/reports/viewReport.action" accesskey="R"> <u>R</u>eports</a></li>
</ul>
</div> <!-- END #menu -->
</div> <!-- END #hd -->
<div id="bd">
<div id="content">
<h1>Header here</h1>
<div class="topMarginned">
        <div id='buildSummaryTabs' class='dashboardTab'>
        </div>
    <script type="text/javascript">
        function initUI(){
            var jtabs = new YAHOO.ext.TabPanel('buildSummaryTabs');
            YAHOO.bamboo.tabPanel = jtabs;


            // Use setUrl for Ajax loading
            var tab3 = jtabs.addTab('allTab', "All Plans");
            tab3.setUrl('/ajax/displayAllBuildSummaries.action', null, true);

            var tab4 = jtabs.addTab("currentTab", "Current Activity");
            tab4.setUrl('/ajax/displayCurrentActivity.action', null, true);


            var handleTabChange = function(e, activePanel) {
                saveCookie('atlassian.bamboo.dashboard.tab.selected', activePanel.id, 365);
            };

            jtabs.on('tabchange', handleTabChange);

            var selectedCookie = getCookieValue('atlassian.bamboo.dashboard.tab.selected');
            if (jtabs.getTab(selectedCookie))
            {
                jtabs.activate(selectedCookie);
            }
            else
            {
                jtabs.activate('allTab');
            }
        }
        YAHOO.util.Event.onContentReady('buildSummaryTabs', initUI);
    </script>
</div>

<script type="text/javascript">
setTimeout( "window.location.reload()", 1800*1000 );
</script>
<div class="clearer" ></div>      
</div> <!-- END #content -->
</div> <!-- END #bd -->  
</div> <!-- END #nonFooter -->
<div id="ft">
    <div id="footer">
        <p>
            Powered by <a href="http://www.atlassian.com/software/bamboo/">Atlassian Bamboo</a> version 2.2.1 build 1206 -

            <span title="15:59:44 17 Mar 2009">17 Mar 09</span>
        </p>
        <ul>
            <li class="first">
                <a href="https://support.atlassian.com/secure/CreateIssue.jspa?pid=10060&issuetype=1">Report a problem</a>
            </li>
            <li>
                <a href="http://jira.atlassian.com/secure/CreateIssue.jspa?pid=11011&issuetype=4">Request a feature</a>
            </li>
            <li>
                <a href="http://forums.atlassian.com/forum.jspa?forumID=103">Contact Atlassian</a>
            </li>
            <li>
                <a href="/viewAdministrators.action">Contact Administrators</a>
            </li>
        </ul>
    </div> <!-- END #footer -->
</div> <!-- END #ft -->

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

信仰 2024-08-26 20:48:35

Sergei,IIRF v2.0 中的 ProxyPass 指令没有正确转发所有请求标头,也没有正确处理分块编码。

要使用 ProxyPass,您至少应该迁移到 IIRF v2.1

ps:你的问题确实属于ServerFault.com

Sergei, the ProxyPass directive in IIRF v2.0 did not correctly forward all Request headers, nor did it properly handle chunked encoding.

To use ProxyPass, you should move to IIRF v2.1, at least.

ps: your question really belongs on ServerFault.com

一花一树开 2024-08-26 20:48:35

“Via: 1.1 DESTINATION_IP (IIRF 2.0)”看起来很有趣。

您是否尝试过:

ProxyPass ^/(.*)$          http://localhost:8085/$1

另外,这行是:

RewriteCond %{HTTP_HOST}   ^bambooi$  [I]

应该是:

RewriteCond %{HTTP_HOST}   ^bamboo$  [I]

That "Via: 1.1 DESTINATION_IP (IIRF 2.0)" looks interesting.

Have you tried:

ProxyPass ^/(.*)$          http://localhost:8085/$1

Also, is the line:

RewriteCond %{HTTP_HOST}   ^bambooi$  [I]

supposed to be:

RewriteCond %{HTTP_HOST}   ^bamboo$  [I]
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文