簡體   English   中英

WSO2ESB簡單直通代理不轉發url擴展名

[英]WSO2ESB Simple Passthrough Proxy doesnt forward the url extensions

我實現了一個簡單的直通代理,即當我打電話時

   "http://wso2esb:9443/services/proxy"  

它應該將請求轉發給

 "http://destinationserver:80/" . 

問題是轉發時不攜帶網址擴展名。即

  when i do a HTTP POST in       

       http://wso2esb:9443/services/proxy/path1/path2 

  the request is forwarded to 

       http://destinationserver:80 

  rather than to  

        http://destinationserver:80/path1/path2. 

  but HTTP GET behaves as expected. Could anyone  help in where i am going wrong?

我的Proxy.xml

  <proxy xmlns="http://ws.apache.org/ns/synapse" name="proxy" transports="https,http"
   statistics="disable" trace="disable" startOnLoad="true">
   <target>
     <outSequence>
         <send/>
     </outSequence>
     <endpoint>
         <address uri="http://destinationserver:80/"/>
     </endpoint>
  </target>
  <description/>
</proxy>

提前致謝!

PS:我的WSO2ESB版本:4.8.1

如果您確實需要,可以(但不確定這是最好的)一種方法來實現您的目標:

<proxy xmlns="http://ws.apache.org/ns/synapse" name="proxy" transports="https,http"
   statistics="disable" trace="disable" startOnLoad="true">
   <target>
      <inSequence>
         <header name="To"
                 expression="concat('http://destinationserver:80',substring-after(syn:get-property('To'),'/services/proxy'))"/>
         <send/>
      </inSequence>
      <outSequence>
         <send/>
      </outSequence>
   </target>
   <description/>
</proxy>

將發布請求發送到http://wso2esb:8280/services/proxy/path1/path2 ,並且應將其轉發到http://destinationserver:80/path1/path2

事情按照Jeans的回答工作,但是Htttp HEAD請求未轉發,除非它返回400 Bad Request。 在目標服務器上使用直接鏈接進行測試將返回預期的響應。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM