cancel
Showing results for 
Search instead for 
Did you mean: 

Reverse proxy settings

Former Member
0 Kudos

Hi,

I have an application which gets called by the client behind a reverse proxy server. I need to make an http call to another application deployed on the same server. How do I construct the URL?

request.getServerName() gives me the name of the reverse proxy server. How do I get the name of the server on which my application is deployed?

Regards,

Anushree

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

I'm a little confused by your original post but let me try to summarize what I think you're asking...

- Application A resides (logically) behind a reverse proxy

- Application A could be accessed directly by calling http://RealAppHost:RealPort/appPath/appName

- Users access this application be calling something like http://RpHost:RpPort/appPath/appName

- Within Application A, you need to make a call to Application B which resides on the same host

- You're unable to get the real host name using a getServerName call when using the app through RP

For starters, everything seems to be functioning as it should... you don't want folks accessing your apps to get the real server name whenever they request it. They should always get the RP name, that's one of the reasons you use RPs.

You've said "I have an app..."  and "...my app is deployed"  Are you the app developer? Lacking further details, I see a very simple solution... how do you deploy your applications? Whatever tool you're using must be connected to that application host to deploy your app so a quick examination of that tool's settings should give you the host name. Alternatively, there must be a member of the Basis or Network Security teams at your office that support those reverse proxies who could quickly examine the rewrite statements in use and give you the host name and port of the application host.

What for of reverse proxy are you using... Apache? ...Web Dispatcher? ...or?

<KC>

Former Member
0 Kudos

Hi Kevin,

Thanks for your reply.Yes I am an app developer.

My application needs the host name to call another application through an http call to the same server.

I need to recover the host name using java code.

Regards,

Anushree

Former Member
0 Kudos

I understand. Unfortunately, I think that might be tough because most systems need to 'know' that they're accessed via reverse proxy in order for their applications to function properly. Since that system is configured to represent itself (ie: how it refers to itself) using the name/port of the reverse proxy it would therefore respond with that name/port when you ask for it.

Good example... a typical ABAP-based system would need table HTTPURLLOC maintained in a standard reverse proxy scenario. If not, any calls of the variety you describe would result in a URL with a different hostname, port, and (potentially) even domain name. Big problem with that is the way session-specific cookies (like SAP logon tickets) work... they can't cross DNS domains. So in that case, your session would be lost when you make that call.

Sorry to say, I'm not sure how to accomplish what you're looking for. But... wouldn't your app still work using the RP alias? It's not the sexiest way to do it but it 'should work'... no?

<KC>

Former Member
0 Kudos

Hi Kevin,

Thanks for the reply.

Regards,

Anushree

Former Member
0 Kudos

Could please be more specific on your requirement ?

what do you find actually ?

Former Member
0 Kudos

Hi Pavan,

Basically I want to find the name of the server on which my application is deployed. Using Request object does not work.

Regards,
Anushree