cloudflare

Is it secure to rely on “X-Forwarded-For” to restrict access by IP in Apache while using Cloudflare?

回眸只為那壹抹淺笑 提交于 2020-08-23 12:34:04
问题 I'm restricting access to a directory to certain IP addresses using a .htaccess file like this: AuthType Basic AuthName "Protected" <RequireAny> Require ip 1.2.3.4 </RequireAny> That works fine in a normal server setup, however when using Cloudflare as a WAF proxy, it stops working since the server receives all requests proxied through Cloudflare's IP. As a workaround, it's possible to use the "X-Forwarded-For" header to identify the client's "real" IP address, since Cloudflare passes this

How to fix ERR_TOO_MANY_REDIRECTS on custom github pages domain?

不羁岁月 提交于 2020-06-26 12:38:48
问题 So I had github pages set up with a custom domain without problem on namecheap a day ago. Then I tried switching to Https via github's newly added support for https on pages. After too much frustration I switched over to CloudFlare for Https but I'm now getting an error ERR_TOO_MANY_REDIRECTS Here's my DNS settings on CloudFlare. 回答1: Check your SSL setting in the Crypto tab. You should have it set to "Full". If it is set to "Flexible", then Cloudflare will use HTTP to connect to the origin,

How to fix ERR_TOO_MANY_REDIRECTS on custom github pages domain?

笑着哭i 提交于 2020-06-26 12:38:06
问题 So I had github pages set up with a custom domain without problem on namecheap a day ago. Then I tried switching to Https via github's newly added support for https on pages. After too much frustration I switched over to CloudFlare for Https but I'm now getting an error ERR_TOO_MANY_REDIRECTS Here's my DNS settings on CloudFlare. 回答1: Check your SSL setting in the Crypto tab. You should have it set to "Full". If it is set to "Flexible", then Cloudflare will use HTTP to connect to the origin,

Cloudflare throws 524 an error on my server

纵然是瞬间 提交于 2020-06-11 01:58:14
问题 Wonder why Cloudflare throws an error on my server which is up? I can verify the server is up by visiting the ip in my browser. I checked system log, apache log, no error found. Btw, I just set the domain on a static site.. I can't figure out how to fix it. Googled and found no solution 回答1: A 524 error states that CloudFlare was able to make a TCP connection to the origin, but the origin did not reply with a HTTP response before the connection timed out. This means that CloudFlare is able to

Cloudflare throws 524 an error on my server

ⅰ亾dé卋堺 提交于 2020-06-11 01:57:08
问题 Wonder why Cloudflare throws an error on my server which is up? I can verify the server is up by visiting the ip in my browser. I checked system log, apache log, no error found. Btw, I just set the domain on a static site.. I can't figure out how to fix it. Googled and found no solution 回答1: A 524 error states that CloudFlare was able to make a TCP connection to the origin, but the origin did not reply with a HTTP response before the connection timed out. This means that CloudFlare is able to

How to make nginx redirect based on the value of a header?

偶尔善良 提交于 2020-06-09 07:54:10
问题 I'm hosting a website behind a Cloudflare proxy, which means that all requests to my server are over port 80, even though Cloudflare handles HTTP (port 80) and HTTPS (port 443) traffic. To distinguish between the two, Cloudflare includes an X-Forwarded-Proto header which is set to "http" or "https" based on the user's connection. I would like to redirect every request with an X-Forwarded-Proto: http header to the SSL version of my site. How can I achieve this with an nginx configuration? 回答1:

How to make nginx redirect based on the value of a header?

拜拜、爱过 提交于 2020-06-09 07:54:07
问题 I'm hosting a website behind a Cloudflare proxy, which means that all requests to my server are over port 80, even though Cloudflare handles HTTP (port 80) and HTTPS (port 443) traffic. To distinguish between the two, Cloudflare includes an X-Forwarded-Proto header which is set to "http" or "https" based on the user's connection. I would like to redirect every request with an X-Forwarded-Proto: http header to the SSL version of my site. How can I achieve this with an nginx configuration? 回答1: