2016-03-25 6 views
0

私はAngus.jsアプリケーションでAccusoftのドキュメントビューアを使用しています。サービスにアクセスする唯一の方法は、自分のディレクトリのいずれかでリバースプロキシの設定を使用することです。このように、私は次のようにweb.configファイルを持っている「PAS-サービス」を設定している:リバースプロキシコールをキャプチャする角とURLの書き換え

<?xml version="1.0" encoding="UTF-8"?> 
<configuration> 
    <system.webServer> 
     <rewrite> 
      <rules> 
       <rule name="ReverseProxyInboundRule1" stopProcessing="true"> 
        <match url="(.*)" /> 
        <action type="Rewrite" url="http://localhost:3000/{R:1}" /> 
       </rule> 
      </rules> 
     </rewrite> 
    </system.webServer> 
</configuration> 

問題は、仕事に対する角度に必要なサイトのリダイレクトルールは、それができる前にこれをキャプチャしているということです呼び出しを返し、index.htmlページを送り返します。ここで

たちは、サイトの主要部分のための私達の書き換えルールに持っているものです。

<rewrite> 
     <rules> 
     <rule name="RemovevesSeldetailsscripts" stopProcessing="true"> 
      <match url="^(.*[/])scripts/(.*)$" /> 
      <conditions> 
      </conditions> 
      <action type="Redirect" url="scripts/{R:2}" /> 
     </rule> 
     <rule name="Removevesseldetailscontent" stopProcessing="true"> 
      <match url="^(.*[/])assets/(.*)$" /> 
      <conditions> 
      </conditions> 
      <action type="Redirect" url="assets/{R:2}" /> 
     </rule> 
     <rule name="Main Rule" enabled="true" stopProcessing="true"> 
      <match url=".*" /> 
      <conditions logicalGrouping="MatchAll"> 
         <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /> 
         <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /> 
         <add input="{REQUEST_URI}" pattern="^/(api)" negate="true" /> 
         <add input="{REQUEST_URI}" pattern="^/(pas-service)" negate="true" /> 
      </conditions> 
      <action type="Rewrite" url="/jbv/index.html" /> 
     </rule> 
     </rules> 
    </rewrite> 

は、どのように私は、サイトの主な書き換えルールは、このリバースプロキシ要求を無視するのですか?それは単に、むしろサービスへの呼び出しの結果を返すよりも、index.htmlページにリダイレクト

http://localhost/jbv/pas-service/Page/q/0?DocumentID=uZcjEtW-7NshOyh8iEIFCx-EbvHyIAuha6D7tbQvV77O_FKs_P-3KN7rB9McjnnisxhPFv1Wy0f7K4t_Hc0Cc6A&Scale=1&ContentType=svga 

:何が起こるかというと、要求は、このURLであるということです。何か案は?

答えて

0

書き換えルールを1セットだけ使用しましたか?代わりに、ちょうどあなたのメインファイルに次のようなものを追加し、二つの別々のルールファイルを使用する:

<rule name="PasRewriteRule" stopProcessing="true"> 
    <match url="^(.*[/])pas-service/(.*)$" /> 
    <conditions> 
    </conditions> 
    <action type="Rewrite" url="http://localhost:3000/{R:2}" /> 
</rule> 

それが最初に一致していることを確認するために、あなたの他のルールの前に、トップにこれを追加します。その後、Accusoftパスサービスフォルダを削除することができます。アプリケーションの正確な設定がわからないので、正規表現を微調整する必要があるかもしれないことに注意してください。