0

I am facing a very strange issue which I cannot solve. Basically, I have 2 VPS machines which I connect via RDP as they are both Windows Server machines. I have cURL on both of them. One is running Windows Server 2016 which we will call SERVER A. The other is running Windows Server 2022 which we will call SERVER B.

If I run curl https://jira.mysite.com:2053/rest/api/2/serverInfo on SERVER A, I get a valid JSON response which is

{"baseUrl":"https://jira.mysite.com:2053","version":"8.22.2","versionNumbers":[8,22,2],"deploymentType":"Server","buildNumber":822002,"buil
dDate":"2022-04-20T00:00:00.000+1000","databaseBuildNumber":822002,"scmInfo":"266c8f51e3b1a891285d611f42f1d6c4389222af","serverTitle":"MY SERVER"
}

However, if I run curl https://jira.mysite.com:2053/rest/api/2/serverInfo on SERVER B, I get HTML

<!DOCTYPE html>
<html lang="en-US">
<head>
    <title>Just a moment...</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge">
    <meta name="robots" content="noindex,nofollow">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <link href="/cdn-cgi/styles/challenges.css" rel="stylesheet">


</head>
<body class="no-js">
...etc

What is going on. Why am I not getting JSON back on SERVER B? This makes absolutely no sense.

My only guess is that the DNS could still be propagating and SERVER B is pulling from an old IP address, but it's been 4 hours since I updated the DNS so I am doubtful that is the problem.

Any suggestions would be appreciated. Thanks.

matead
  • 1
  • 3

1 Answers1

0

I found the problem. It seems that Cloudflare is intervening before the JSON is sent, hence why SERVER B has that HTML as the response. Cloudflare is issuing a check and then redirecting afterwards when it passes.

How to fix it

https://stackoverflow.com/questions/18500088/curl-load-a-site-with-cloudflare-protection https://community.cloudflare.com/t/how-to-whitelist-ips-through-cloudflare/417224

matead
  • 1
  • 3