Forum Discussion
How to keep the internal URL in browser address bar and point to external website
Is there a way to keep internal web address all the time and point it to public URL?
Let's say I have internal web address called honest2.company.com which has 10.10.2.35 and have public website hosted on Azure let's say abc123pqr456xyz789.azurewebsites.net and I create a VIP honest2_company_http VIP for 10.10.2.35; now anyone from my company access http://honest2.company.com for users the URL always remain as http://honest2.company.com but it will display content of abc123pqr456xyz789.azurewebsites.net
Is it possible via iRule, forward or reverse proxy or any other way? Please give me some pointers or clue.
- ekaleido_26616Cirrocumulus
Can't you just create an A record for honest2.company.com pointed at 10.10.2.35 and call it a day? It feels like we're greatly overthinking this. Make the pool member the actual IP of the real webserver and configure the webserver to handle requests for honest2.company.com. There is no need for iRules here as best I can tell.
- SoLuckyNimbostratus
I did what you said but it still displays azure URL.
- ekaleido_26616Cirrocumulus
Create a pool, make the external server the sole member. You're now proxying, users see the URL you want them to see, and you don't have to use an iRule.
- SoLuckyNimbostratus
I know and I feel the same but we don't have pool (or any pool member) and need to use it as proxy, I hope it make sense.
- ekaleidoCirrus
Can't you just create an A record for honest2.company.com pointed at 10.10.2.35 and call it a day? It feels like we're greatly overthinking this. Make the pool member the actual IP of the real webserver and configure the webserver to handle requests for honest2.company.com. There is no need for iRules here as best I can tell.
- SoLuckyNimbostratus
I did what you said but it still displays azure URL.
- ekaleidoCirrus
Create a pool, make the external server the sole member. You're now proxying, users see the URL you want them to see, and you don't have to use an iRule.
- SoLuckyNimbostratus
I know and I feel the same but we don't have pool (or any pool member) and need to use it as proxy, I hope it make sense.
- Vijay_ECirrus
Try something like this example:
when HTTP_REQUEST { if { [HTTP::host] contains "abcd.com" } { HTTP::host [string map {abcd.com xyz.com} [HTTP::host]] } } when HTTP_RESPONSE { if { [HTTP::header values Location] contains "xyz.com" } { HTTP::header replace Location [string map {xyz.com abcd.com} [HTTP::header value Location]] } }
- Hannes_Rapp_162Nacreous
That's a fairly basic problem and I recommend you look into LTM Local Traffic policy feature for the most performance-efficient solution. However, you can also use an iRule provided below. Of course, you will also need two DNS entries - one of which is used by the general public, the other for your private LAN users/employees.
when HTTP_REQUEST { if { ([HTTP::host] eq "abc123pqr456xyz789.azurewebsites.net") && (not ([class match [IP::client_addr] eq "private_net" ])) }{ HTTP::header replace Host "honest2.company.com" } }
- SoLuckyNimbostratus
Not sure about that, though your iRule looks good and somehow I was hoping to work as it is. I will keep digging and see if I can get any success, thanks for your help.
- Hannes_Rapp_162Nacreous
Possibly not NATed to external IP, or in general, something is not properly routed. Check with tcpdump to see what's going on. This is generally something the forum cannot assist you with as we don't have the overview of your network. Another idea to further isolate the troubleshooting scope is to try connecting from the outside internet.
- SoLuckyNimbostratus
Source Address Translation option was at "Auto Map", I tried with "None" but still getting "This page can’t be displayed". I also tried replacing abc123pqr456xyz789.azurewebsites.net with www.google.com but no luck.
- Hannes_RappNimbostratus
That's a fairly basic problem and I recommend you look into LTM Local Traffic policy feature for the most performance-efficient solution. However, you can also use an iRule provided below. Of course, you will also need two DNS entries - one of which is used by the general public, the other for your private LAN users/employees.
when HTTP_REQUEST { if { ([HTTP::host] eq "abc123pqr456xyz789.azurewebsites.net") && (not ([class match [IP::client_addr] eq "private_net" ])) }{ HTTP::header replace Host "honest2.company.com" } }
- SoLuckyNimbostratus
Not sure about that, though your iRule looks good and somehow I was hoping to work as it is. I will keep digging and see if I can get any success, thanks for your help.
- Hannes_RappNimbostratus
Possibly not NATed to external IP, or in general, something is not properly routed. Check with tcpdump to see what's going on. This is generally something the forum cannot assist you with as we don't have the overview of your network. Another idea to further isolate the troubleshooting scope is to try connecting from the outside internet.
- SoLuckyNimbostratus
Source Address Translation option was at "Auto Map", I tried with "None" but still getting "This page can’t be displayed". I also tried replacing abc123pqr456xyz789.azurewebsites.net with www.google.com but no luck.
Recent Discussions
Related Content
* 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