Allow access api form localhost

[root@bw-ss2 blog-and-tools]# curl -vv

  • About to connect() to port 2368 (#0)
  • Trying…
  • Connected to ( port 2368 (#0)

GET /ghost/api/v2/content/settings/?key=assxxxxxxxxxxxxxxxxa HTTP/1.1
User-Agent: curl/7.29.0
Accept: /

< HTTP/1.1 301 Moved Permanently
< X-Powered-By: Express
< Cache-Control: public, max-age=31536000
< Access-Control-Allow-Origin: *
< Location:
< Vary: Accept, Accept-Encoding
< Content-Type: text/plain; charset=utf-8
< Content-Length: 119
< Date: Fri, 21 Jun 2019 10:57:48 GMT
< Connection: keep-alive

  • Connection #0 to host left intact
  • What version of Ghost are you using?

@huangyanxiong01 do you have your url configured as “https”? If so, your request to localhost when using “http://localhost:2368” will be automatically redirected to the configured https url.

Quick-fix is to change your configured url to http://localhost:2368 if this is a local development install. If you want to keep the configured url you will need to send requests to https://localhost:2368 or add the X-Forwarded-Proto header as in curl -H 'X-Forwarded-Proto: https' http://localhost:2368/...

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.