http redirect
39 TopicsBIG-IP : redirect loop : debugging techniques
BIG-IP 11.4.0 Build 2384.0 Final In my hosts file I point www.mydomain.com to my web-server IP, and in my client-browser I submit the request http://www.mydomain.com/natural-language-url-1 and the page is returned as expected.. In BIG-IP , I have configured a single virtual-server vip-01 with a single iRule irule-01 : when HTTP_REQUEST { log local0. "HTTP_REQUEST received by irule-01" log local0. "host = [HTTP::host]" log local0. "uri = [HTTP::uri]" switch -glob [string tolower [HTTP::host]] { "www.mydomain.com" { switch -glob [string tolower [HTTP::uri]] { "/api/*" { pool service-pool-01 } default { log local0. "matched default pool" pool default-pool-01 } } } } } Now, in my hosts file I point www.mydomain.com to vip-01 , and in my client-browser I submit the request http://www.mydomain.com/natural-language-url-1 and the client-browser reports an infinite-redirect error "This webpage has a redirect loop" BIG-IP > System > Logs > Local Traffic Rule /Common/irule-01 : HTTP_REQUEST received by irule-01` Rule /Common/irule-01 : host = www.mydomain.com Rule /Common/irule-01 : uri = /natural-language-url-1 Rule /Common/irule-01 : matched default pool ... repeat 10 times ... Fiddler shows that 21 302-redirects have occurred : Result 302 Protocol HTTP Host www.mydomain.com URL /natural-language-url-1 Body 185 Caching private Content-Type text/html; charset=utf-8 Process chrome:7516 Comments Custom NOTE 1 : on vip-01, Source Address Translation = Auto-Map NOTE 2 : I have complete control over the web-server ( remote access with ability to modify configuration, run diagnostics, perform local tests, etc. ) NOTE 3 : The web-server expects the request to include the domain. Sending a request with host = {web-server-host-name} , or host = {web-server-ip} will throw an error because IIS will be unable to locate the virtual app. What are some debugging techniques I can deploy to further diagnose the underlying cause of the redirect loop ?1.3KViews0likes28CommentsHTTP to HTTPS redirect over the same port
Hello, i hope you can help me. I need an http to https redirect to the same port. For example I enter the URL http://dev.intern.com:25001 and I want to get redirected to https://dev.intern.com:25001. I tried a second virtual server but this didn't work because the loadbalancer can't have two the same IP and ports for a second server which redirects it with an irule to the https virtual Server which is understandable. Thank you already and best regards!854Views1like2CommentsSimple HTTP session termination then back end session to web server
Hello Gurus! I'm VERY new to LTM but I suspect this one will be simple. I've got an internal web app that simply uses http on port 80 from a company we acquired, which is currently on their local AD domain. We'll call it http://currenturl.olddomain.local/webapp. In order to get our users that come in over our global WAN into a higher queue in QOS I need them to make connections on a custom port (8052), but we don't want to change the web server. So, I want provide the users across the pond a totally different URL that terminates at the F5 on http port 8052 (http://newurl.ourdomain.com:8052/) and then have the F5 proxy the session to the web server by opening a new connection on the back end to the web server on the actual URL (http://currenturl.olddomain.local/webapp). Any help or article references would be much appreciated!734Views0likes22CommentsSOAP HTTPS redirects not working (Postman / SoapUI)
Hello, I am using the Postman application, as well as SoapUI, to test some SOAP requests to an application that is behind our F5 WAF. When I send SOAP HTTPS POST requests, the WAF handles the request perfectly and all tests pass. However, when I send these requests over HTTP, tests do not succeed and I get an HTTP 500 error. To be clear, I have the default F5 iRule attached to the virtual server to redirect HTTP requests to HTTPS, and it does work. If I make a request to the site through the browser over HTTP, it gets sent to HTTPS. As another side note of troubleshooting, I have seen old threads that mention the Postman Interceptor Chrome extension being necessary for some API testing. I have installed it, turned it on, and I still get the same issues. My next step was turning on HTTP Analytics logging and looking at some of these requests to see if I could spot a difference between where we force HTTPS and where we leave it as HTTP. From what I can tell, it looks like every HTTP 500 response shows that it was a GET request... which is wrong, because the tests are configured as an HTTP POST. So to me it seems like the WAF is redirecting the HTTP POST to an HTTPS GET, which is why we get the 500 response code. Does this sound like anything someone has seen before? Any insight as to why this is occurring is appreciated.712Views0likes3CommentsiRule w/Special Character (#) in Original URI
I am using my standard redirect syntax, however I believe it is broken due to using a in the source URI. I've tried using a \ to escape it, as well is curl brackets with no success. Help would be greatly appreciated! when HTTP_REQUEST priority 450 { switch -glob [string tolower [HTTP::host]] { "www.integration.domain.com" { switch -glob [string tolower [HTTP::uri]] { "/blah1/blah2.aspx/" { HTTP::respond 301 Location "https://www.integration.domain.com/newsite/site.aspx!/" }567Views0likes3CommentsiRule Redirect loop
Hi I am trying to achieve a simple URL redirect but I keep getting a redirect loop or nothing at all. I get an error of "too many redirects" Condition 1 All requests to "; must be redirected to https://test.tst.train123.com/trace123 only But any other traffic eg. "; must continue to the default pool My problem is when I use the the irule below I get a redirect loop when HTTP_REQUEST { if { [HTTP::host] equals "test.tst.train123.com" } { HTTP::redirect "https://test.tst.train123.com/Trace123 [HTTP::uri]" } } When I try this it doesnt seem to work either. I know I am missing something when HTTP_REQUEST { if { [HTTP::uri] equals "test.tst.train123.com"} { HTTP::redirect "/Trace123" } elseif { [HTTP::uri] equals "; } { pool pool_trace123 } }510Views0likes2CommentsiRule to rewrite url in server response to client
I have a simple VS with 1 pool member, when the user goes to the URL (https://myurl.com) they are redirected to the full path (https://myurl.com/uri/login.jsp) just fine and are presented with a login prompt. After the enter their credentials and click the login button the server replies with the FQDN of the server (). I have tried to modify the following irule to try to fit my need and while it does change the URL from the server name to the correct URL it does not work. Original iRule: Modified iRule: So then i found another simpler (seemed) but this ones did not change the URL at all Can anyone tell me what i am doing wrong or suggest a better way of doing this? On a normal day i would tell them to change the server response (because i can see on my capture the server is sending the re-direct) but we are on a tight deadline and i need to find a workaround before Friday.499Views0likes1CommentUse APM variable in redirect ending for VPE
Trying to clean up my VPE, would like to create a handful of macros and have minimal endings: allow, deny, redirect, etc. Is it possible for me to use a variable on a Redirect ending in the redirect URL box? Does it take TCL at all? I was hoping to just use a redirect to https://{[mcget {session.server.network.name}]} or something. Maybe tack on a URI variable also. Worst case scenario, I could use an iRule on ACCESS_ACL_DENIED if I'm not able to do this in VPE, correct? Any other events I should consider? Also, are there any limits on Macro calls in a VPE? Nested Macro calls? Not trying to do any loops or anything. Thank you.499Views0likes2Commentsirule redirect on uri including default location
Im having trouble with requests that i need to redirect based on uri. My irule is when HTTP_REQUEST { switch -glob [string tolower [HTTP::uri]] { "/test/" - "/test1/" { HTTP::redirect "http://redirected.server.com[HTTP::uri]" } default { pool POOL_MainPool_Server-80 } } } I want to have any request that is for www.request.com/test to go to second server. It works fine for any request that includes the / eg: www.request.com/test/ but not without the / If i remove the / from my irule eg "/test" then any request such as www.request.com/testing also redirects but I dont want it to. Also I dont want it picking up on the secondary level eg /Firstlevel/test/ I want the exact match of /test/ but include if the request is just default page /test Does anyone now how I would go about this? Thanks in advance Brett461Views0likes5Comments