Tim
Tim

Reputation: 6441

Why is Cloudflare returning a 302 redirect to the origin server?

Cloudflare suddenly returns a 302 redirect to the origin domain, which breaks our AJAX calls, although the CORS headers are still in place.

curl -I https://cloudflare-domain.com/channel/4d90dd64aa4a4fd8a3cad8862fd88c67/?limit=12

HTTP/1.1 302 Found
Date: Fri, 29 Sep 2017 15:38:22 GMT
Content-Type: text/html; charset=iso-8859-1
Connection: keep-alive
Set-Cookie: __cfduid=dc5840cbd96478011d1bb040fcb6fc7e81506699502; expires=Sat, 29-Sep-18 15:38:22 GMT; path=/; domain=.cloudflare-domain.com; HttpOnly
Location: https://origin-domain.com/channel/4d90dd64aa4a4fd8a3cad8862fd88c67/?limit=12
CF-Cache-Status: HIT
Expires: Fri, 29 Sep 2017 17:38:22 GMT
Cache-Control: public, max-age=7200
Server: cloudflare-nginx
CF-RAY: 3a600770fec427aa-FRA

We haven't changed any settings, either in Cloudflare or on the origin server.

Any ideas why this could suddenly happen?

Upvotes: 1

Views: 5158

Answers (2)

Houssam Zaki
Houssam Zaki

Reputation: 11

Update: Go to search and type "SSL/TLS" and change to Full strict Screenshot SSL/TLS Settings 302 Found cloudflare

Screenshot SSL/TLS Settings 302 Found cloudflare

Upvotes: 1

Tim
Tim

Reputation: 6441

Found the problem: a change was made on the origin server.

We put in a redirect to enforce HTTPS, but Cloudflare was connecting over HTTP. The redirect was being returned by the origin server.

Solution: In the Cloudflare settings, under Crypto, select Full SSL (strict).

Upvotes: 4

Related Questions