Score:0

Jira - REST API returns HTML on one VPS but JSON on another VPS

gm flag

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.

Score:0
gm flag

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

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.