Forum Discussion
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 '[email protected]'
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
- Kevin_Stewart
Employee
I don't believe that's possible natively within a single cURL statement. A few options though:
-
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.
-
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.
-
- Julio_Navarro
Cirrostratus
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
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