For more information regarding the security incident at F5, the actions we are taking to address it, and our ongoing efforts to protect our customers, click here.

Forum Discussion

Julio_Navarro's avatar
Julio_Navarro
Icon for Cirrostratus rankCirrostratus
Jun 25, 2014

external monitor curl redirect location

Hello;

 

I am creating a external monitor in sh where is working fine only if the landing page doesn't changes.

 

Now, I can use curl option "-L" but is not working becuase is not using the IP on the URL, and its substituting with the URL from the server response.

 

From the capture a pasted here, it will use the IP 10.1.1.2 and appended to the URI found in the Location response here as http://url.domain.com/Pages/Default.aspx to have http://10.1.1.2/Pages/Default.aspx.....

 

Is there a way to have it use the original IP Address? Is this possible?

 

< MicrosoftSharePointTeamServices: 15.0.0.4561 < X-Content-Type-Options: nosniff < X-MS-InvokeApp: 1; RequireReadOnly < Date: Wed, 25 Jun 2014 17:02:03 GMT < Content-Length: 0 < * Connection 0 to host 10.1.1.2 left intact * Issue another request to this URL: 'http://10.1.1.2:80/' * Re-using existing connection! (0) with host 10.1.1.2 * Connected to 10.1.1.2 (10.1.1.2) port 80 (0) * Server auth using NTLM with user 'account@domain.com'

 

GET / HTTP/1.1 Authorization: NTLM TlRMTVNlhsdfljhsldfslkdfjklsdfMDE= User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 OpenSSL/0.9.8y zlib/1.2.3 libidn/0.6.5 Accept: / Host: url.domain.com

 

< HTTP/1.1 302 Redirect < Content-Type: text/html; charset=UTF-8 < Location: http://url.domain.com/Pages/Default.aspx .. .. ... < X-FRAME-OPTIONS: SAMEORIGIN < SPRequestDuration: 12 < SPIisLatency: 0 < Persistent-Auth: true < X-Powered-By: ASP.NET < MicrosoftSharePointTeamServices: 15.0.0.4561 < X-Content-Type-Options: nosniff < X-MS-InvokeApp: 1; RequireReadOnly < Date: Wed, 25 Jun 2014 17:02:03 GMT < Content-Length: 175 < * Ignoring the response-body * Connection 0 to host 10.1.1.2 left intact * Issue another request to this URL: 'http://url.domain.com/Pages/Default.aspx' * About to connect() to url.domain.com port 80 (1) * Trying 199.1.1.12... Timeout * connect() timed out! * Closing connection 1 * Closing connection 0

 

Thank you

 

2 Replies

  • I don't believe that's possible natively within a single cURL statement. A few options though:

     

    1. If you know that you're going to be redirected to a specific URI, issue the original cURL request with this URI to potentially avoid the redirect.

       

    2. Create a local Hosts entry on the LTM and point url.domain.com to 10.1.1.2.

       

    Worst case you could still use cURL without -L, capture the response and parse the location header, and then make a new request. This would make for an interesting shell script, but definitely possible.

     

  • Thank You Kevin! I think I will create a script capturing the "location" field.... And Yes....it will be an interesting shell script.... Thank you