cancel
Showing results for 
Search instead for 
Did you mean: 

URL Prefix in a reverse proxy scenario

Former Member
0 Kudos

Hi,

we actually have a problem with url-generation in our reverse proxy scenario.

We configured our reverse proxy (apache; not a web dispatcher) to map an url from

> http://external-host/url-prefix/irj/portal

to

> http://internal-host:50000/irj/portal

Our problem is that the html portal logon page generates absolute urls to resources like http://external-host/com.sap.portal.epcf.loader/... As you can see it is dropping the url-prefix. So our pages are not displayed properly and forms cannot be submitted.

Is there a way to tell the url generator to put a prefix into each generated absolute url?

We have SAP Netweaver Portal 7.31

thanks & regards,

  Christian Buschmann

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Easiest way is to map /, the more tedious one is to list all the prefixes that need mapping. Depending on what resources you access on AS JAVA, the list can grow significantly (mine in the past had about 10 entries).

Former Member
0 Kudos

Thanks for your quick response.

Do you mean to map all requests received on our reverse proxy to and beyond / to our SAP Portal? This won't work because the reverse proxy serves some more web applications and not only the sap portal. To map / would break other applications (ruby, static sites, etc.) which are also served.

So our structure looks like this:

http://external-host/static content

http://external-host/app1/some_ruby_app1

http://external-host/app2/irj/portal

http://external-host/app3/some_ruby_app2

http://external-host/app...

So to have clean configuration on our reverse proxy every absolute (resource)-link which is generated by the sap-portal should be prefixed with /app2/

Is there any possibilty to tell the url generator to put a prefix on generated urls?

Former Member
0 Kudos

Anything is possible. A recommended configuration would be for you to setup DNS aliases for all of your applications (SAP Portal, Ruby, etc.). That way you can have virtual host specific reverse proxy mappings. Believe me, it will pay off. Having a non-standard configuration means you will have to implement tweaks here and there not to mention how painful it is to maintain such a configuration.

Still, if you want to try it out try the following configuration



<Directory /app2>          

          ProxyPass /app2/ htp://portalhost/          

          ProxyPassReverse /app2/ http://portalhost/

</Directory>


Apache will use URL prefix /app2 for any URL generated by AS JAVA. That said, you will run into problems eventually since URLs get generated in so many ways, including URLs within HTTP responses which Apache will not change.

Former Member
0 Kudos

Samuli Kaski wrote:

Anything is possible. A recommended configuration would be for you to setup DNS aliases for all of your applications (SAP Portal, Ruby, etc.). That way you can have virtual host specific reverse proxy mappings. Believe me, it will pay off.

Yeah, that's what we have done on other sites. But it has the drawback that you have to get seperate ssl-certificates (extended validation) for each domain or have to update the existing ssl-certificate with additional dns-aliases.

So we tried on this site to sepearte each application by url-prefixes. So each application is covered by the same certificate.


Having a non-standard configuration means you will have to implement tweaks here and there not to mention how painful it is to maintain such a configuration.

Still, if you want to try it out try the following configuration

<Directory /app2>          

          ProxyPass /app2/ htp://portalhost/          

          ProxyPassReverse /app2/ http://portalhost/

</Directory>

Apache will use URL prefix /app2 for any URL generated by AS JAVA. That said, you will run into problems eventually since URLs get generated in so many ways, including URLs within HTTP responses which Apache will not change.

That's our problem now. Apache does map the url from http-request but the http-response-content from sap-portal is untouched. So absolute links within html pages generated by sap-portal are pointing to the wrong path. Protocol, host and port are correct but the path is missing the url-prefix.

So i don't want our apache to correct the links and rather want sap-portal to produce correct links. It's working fine with protocol, host and port for urls, but i can't set an url-prefix for the path-component.

So my hope is that you can make the url generator from sap portal aware of our url-prefix (maybe depending of virtual host, or by setting a field in http-request) like it's aware of incoming protocol, host and port. So that every generated link will get an url-prefix for it's path component.

Former Member
0 Kudos

You could try to use Java Logon Groups, there is support for prefixes. I haven't used it so I don't know how it affects URL generation.

Former Member
0 Kudos

I tried it with logon groups, but with no success. We will stick with subdomains.

Thanks for your help!