msaud
1
Hi Team,
Can someone please help me to build the irule script.
I have two VS
VS1: vs_tableau.ucsf.edu_443
pool: pool_tableau.ucsf.edu_443
VS2: vs_tableauqa.ucsf.edu_443
pool:pool_tableauqa.ucsf.edu_443
I wanted to redirect the below URL:
FROM - https://tableau.ucsf.edu/#/site/QA/views/AllTableauDashboards/AllTableauDashboards
TO - https://tableauqa.ucsf.edu/#/site/QA/views/AllTableauDashboards/AllTableauDashboards
Note: This is single URL as of now but there would be multiple URL in future to redirect from
tableau.ucsf.edu to tableauQA.ucsf.edu
Hi,
Use this iRule:
when HTTP_REQUEST {
if { [HTTP::host] equals "tableau.ucsf.edu"} {
HTTP::redirect "https://tableauqa.ucsf.edu[HTTP::path]"
}
}
I haven’t tested it, so check it and let me know.
Also you can do it using LTM policy , it much lightweight compared with irules and pretty much easy
See this article it has the idea: https://my.f5.com/manage/s/article/K15117465
msaud
3
Hi,
I don’t get you.
Have you applied the irule that I sent in my reply, this irule should redirect the hostname but keeps the rest of URI.
please clarify more
msaud
5
Hi @msaud
My code should grantee this, it will copy the path in first request to the redirected request.
If you change the first request like this :
https://tableau-snd.ucsf.edu/#/site/QA/views/ProjectChartfieldSearch/newone
the redirected request will be like that:
https://tableauqa.ucsf.edu/#/site/QA/views/ProjectChartfieldSearch/newone
so it should work.
Take a packet capture and see what’s going on
Feel free to share it with me if this available with you
msaud
7
Hi @msaud ,
This irule should meet your needs in the last query:
when HTTP_REQUEST {
if { [HTTP::host] equals "tableau-snd.ucsf.edu"} {
HTTP::redirect "https://tableauQA.ucsf.edu[HTTP::path]"
}
}
You may need to adjust your DNS A record for this FQDN : tableauQA.ucsf.edu.
Take a Packet capture after deploying this irule and see what happen.
Also you can perform this using LTM policy