Forum Discussion
Gary_Walderich_
Nimbostratus
Apr 25, 2007Masking/Hiding original URL?
I am currently working on configuring a BigIP within an SAP environment, and need to know if I can mask/hide the original URL with a standard URL. Reason, I do not want users to know the entire URL address along with the SAP port and directories that is being used to access the SAP servers.
I currently have a Virtual server located on SAP port 50100 over https using a client ssl profile. The virtual server then connects to a pool with a single SAP server over port 50100 over http.
Right now, to get to the virtual server you have to go to the following: https://users.test.com:50100/irj/portal. What I would like to see is https://users.test.com within the URL. Can this be done with an iRule, and if so, how? Again, what my goal is, is to keep the original URL hidden /Masked from users, to make it look like a normal address.
Current BigIP code I am utilizing on the LTM is 9.4.
Many Thanks!
-GW
- Deb_Allen_18Historic F5 AccountRight now, to get to the virtual server you have to go to the following: https://users.test.com:50100/irj/portal. What I would like to see is https://users.test.com within the URL.First change the port on the virtual server from port 50100 to 443. That way clients can browse to https://host/uri. Virtual servers by default translate the port to the real ports of the pool members.
And last, you also will need to translate inbound requests to prepend the real portal path to the URI, which is also handled by an iRule:when HTTP_RESPONSE { if { [HTTP::status] starts_with "3" } { HTTP::header replace Location [string map {":50100/irj/portal" "" } [HTTP::header Location]] } }
Put the 2 snips together in 1 iRule and apply to the port 443 virtual server, and you should be set.when HTTP_REQUEST { HTTP::uri "/irj/portal[HTTP::uri]" }
- Gary_Walderich_
Nimbostratus
deb, - Deb_Allen_18Historic F5 AccountLet's add some logging to the iRule to see what's going on:
Log will write to /var/log/ltm, or Local Traffic log in the GUI. Examine output for clues.when HTTP_REQUEST { set origURI [HTTP::uri] set newURI "/irj/portal[HTTP::uri]" HTTP::uri $newURI log local0. "Original URI: $origURI" log local0. "Rewritten URI: $newURI" } when HTTP_RESPONSE { if { [HTTP::status] starts_with "3" } { set origRedir [HTTP::header Location] set newRedir [string map {":50100/irj/portal" "" } [HTTP::header Location]] HTTP::header replace Location $newRedir log local0. "Original redirect: $origRedir." log local0. "Rewritten redirect $newRedir" } }
- Deb_Allen_18Historic F5 AccountMeant also to say, since you're not seeing even the first page, I suspect the URI re-writing in the HTTP_REQUEST event is not happening as expected, and I'd start looking more closely at that first.
- Deb_Allen_18Historic F5 Accountum, yeah...
- Gary_Walderich_
Nimbostratus
Here is the output from the log file... - Deb_Allen_18Historic F5 AccountClick here for a post containing a discussion of that error.
- Gary_Walderich_
Nimbostratus
Thanks deb. - Deb_Allen_18Historic F5 AccountWell, the 400 Bad Request error is because the request received by the server was for ":50100/irj/portal/" -- the ":50100" part shouldn't be there.
- Deb_Allen_18Historic F5 AccountMore information about what you saw in your incremental testing would be helpful. Does it work without the iRule, or are the errors still seen? If errors are still seen without the iRule applied, how about without the HTTP profile or the iRule?
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects