cancel
Showing results for 
Search instead for 
Did you mean: 

web dispatcher url Rewritting to several sap systems

RuAn
Discoverer
0 Kudos

Hello SAP NW Community,

we need a reverse Proxy to achieve   application of different SAP System via Internet. We desided to use web Dispatcher.

The host names of sap systems should not be visible,  because of this we create the following URL Rewritting rules.

For example:

AAA, BBB and CCC are sap System SIDs;

"wdisp.company.com" is the FQDN fron webdispatcher

The "icm_filter" Looks like this:

#--------------------------------------------------------------

if% {HTTP_HOST} RegIMatch "wdisp.company.com"[and]

If% {PATH} RegIMatch "AAA"

RegIRewriteUrl ^/AAA/(.*)  /$1 [noescape]

SetHeader x-sap-webDisp-target-sid AAA [break]

#---------------------------------------------------------------

the next rules are the same but for BBB and CCC.

The idea is to rewrite in background all URLs such as:

http(s)://wdisp.company.com/AAA/...

to :

http(s)://<FQDN from AAA>/...

The result is always the same: the rewritting for AAA works fine but for BBB and CCC we get -http error 404.

The results are independent from web browser(IE or Firefox).

The http trace Tools- HttpWatch Basis or Firebug show also no rewritting  for BBB und CCC.

According the documentation is web Dispatcher able to support  many "stateful" and "stateless"  connection to different backend sap System.

Do you have any ideas why the rewritting works only for the first sap System?

We tested with different browser and Browser sessions but the resul was the same.

BR,

Rumen

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Hi Rumen,

You cannot group multiple rule lines together into one block. So the line

SetHeader x-sap-webDisp-target-sid AAA [break]

does not belong to the preceding if-condition and will always be executed. And because of the [break], no other conditions will be evaluated including the BBB anad CCC conditions.

Anyways, your approach with URL rewriting will likely not work, because the SAP system is constantly generating new URLs, and the system does not know about your little URL prefix scheme and will not insert AAA or BBB into the generated URLs. All generated URLs will not work.

A better solution is to use different ports, as Vagesan already described.

Or as an alternative, you could use different virtual host names e.g. AAA.company.com, BBB.company.com. This is easily achieved by using the latest Web Dispatcher 7.41 and following note 2010948.

Best,

Tobias

RuAn
Discoverer
0 Kudos

Hi Tobias,

thanks.

So the URL Rewritting works only in one direction. The incomming URLs(http-reguests) will be convert to internal URLs. But for the way back is the rewritting of the http-requestes not possible.

In our case your proposal should be implemented with external DNS alias. These all should point to the Web Dispatcher and with the  following simple rules, should  work for each backend SAP system:

     if %{HTTP_HOST} regimatch AAA.company.com* 

     SetHeader x-sap-webdisp-target-sid AAA [break] 

     if %{HTTP_HOST} regimatch BBB.company.com*

     SetHeader x-sap-webdisp-target-sid BBB [break]

Is that right?

BR,

Rumen

0 Kudos

Hi Rumen,

You need the rules only for Web Dispatcher 7.2x. I recommend to update to Web Dispatcher 7.41 and follow the note I mentioned. Then you no longer need any modification rules, but simply specify SRCVHOST in the wdisp/system_x parameters instead.

Best,

Tobias

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Instead of PATH , use different pots like this, you can get the URL redirection,

icm_filter.txt :

if %{HTTP_HOST} regimatch wdhost.company.com* 

SetHeader x-sap-webdisp-target-sid AAA [break]

if %{HTTP_HOST} regimatch wdhost.company.com*

SetHeader x-sap-webdisp-target-sid BBB [break]

if %{HTTP_HOST} regimatch wdhost.company.com*

SetHeader x-sap-webdisp-target-sid CCC [break]

In Instance profile :

wdisp/system_0 = SID=AAA,MSHOST= AAA.HostNane ,MSPORT=8111

wdisp/system_1 = SID=BBB,MSHOST= BBB.Hostname ,MSPORT=8100

wdisp/system_2 = SID=CCC,MSHOST= CCC.Hostname ,MSPORT=8101

URL :

http://wdhost.company.com:8111 --- goes to AAAhost and so on.

regards

Vagesan

RuAn
Discoverer
0 Kudos

Hi Vagesan,

thanks for the quick Response.

your suggestion the communication with each backend system on a unique port is not feasible in our case.

Since the web dispatcher is in DMZ we can not open 50 different ports to 50 different backend Systems.

The web Dispatcher dokumentation in sap.help.com  allows our approach.The uniqueness of each incomming request  could be achieved by the SID (AAA, BBB, CCC) in the URL.

BR

Rumen