How to get port number in a url in xpage in BeforePageLoad event?

How to get port number in a url in xpage in BeforePageLoad event?

Here is my Platform: windows x64 + domino 9.0.0
reverse proxy: Nginx

Here is my situation.

I have 12 domino servers running inside of corp.

And I setup a reverse proxy server called m.corp.com to visit these domino servers using ports from 81 to 92.

for example:

I wish to get the following url into xpages code.

https://m.corp.com:81/cc.nsf/vfdefault.xsp?documentId=3A47BD1C3BF869DD48257C4C001EBBB0&action=openDocument https://m.corp.com:81/cc.nsf/vfdefault.xsp?documentId=3A47BD1C3BF869DD48257C4C001EBBB0&action=openDocument

I try to use

context.getUrl()

Then I get https://m.corp.com/cc.nsf/vfdefault.xsp?documentId=3A47BD1C3BF869DD48257C4C001EBBB0&action=openDocument https://m.corp.com/cc.nsf/vfdefault.xsp?documentId=3A47BD1C3BF869DD48257C4C001EBBB0&action=openDocument

This is not correct.

Then I tried facesContext.getExternalContext().getRequest().getRequestURL()

still the same problem.

I need to get the url in the beforepageload event.

The question is :

is there a xpage code can get the full url including the port number?

context.getUrl().toString().split(facesContext.getExternalContext().getRequest().getRequestURI())[0]

does not working.

return the result of http://m.corp.com/cc.nsf/vfdefault.xsp?documentId=3A47BD1C3BF869DD48257C4C001EBBB0&action=openDocument http://m.corp.com/cc.nsf/vfdefault.xsp?documentId=3A47BD1C3BF869DD48257C4C001EBBB0&action=openDocument

The port number 81 was eaten by xpage code.

then I found https was also eaten by xpages code.

is there any body has any idea for this?
Or it’s a bug for xpage?

Any fix for this?