Getting 308 Permanent Redirect

I am getting following response when I use Influxdb web api’s on my local machine and AWS instance:

<html>
<head><title>308 Permanent Redirect</title></head>
<body>
<center><h1>308 Permanent Redirect</h1></center>
<hr><center>nginx</center>
</body>
</html>

This is encountered only when the api’s are run through the code.
But I don’t get this response when I use the postman to access the api.

API Request Details.:

GET: https://eu-central-1-1.aws.cloud2.influxdata.com/api/v2/buckets?orgID=<my_org_id>
 HEADERS: 
    Authorization: 'Token <my_token>',
    Host: 'eu-central-1-1.aws.cloud2.influxdata.com',
    Accept: '*/*',
    Connection: 'keep-alive',
    Content-Type: 'application/json,
    Cache-Control: no-cache

I never got this response when I was using the “ap-southeast-2” region.
Please help in resolving this.

Thanks,
Varad

Ok I found the issue.
I was actually hitting the request through “http” module instead of “https” in Node.js.
It returned a redirect location which my code was not handling.
Using the “https” module of Node.js fixed my issue.

Thanks,
Varad

Hello @varad,
Thank you for sharing your solution!! :slight_smile: