cloudflare

Can one cache and secure a REST API with Cloudflare?

孤者浪人 提交于 2019-12-20 09:28:50
问题 I am designing a RESTful API that is intended to be consumed by a single-page application and a native mobile app. Some calls of this API return public results that can be cached for a certain time. Moreover, there is a need for rate protection to protect the API against unauthorized users (spiders) Can I use Cloudflare to implement caching and rate-limiting / DDOS protection for my RESTful API? Caching: Cloudflare supports HTTP cache control headers so the API can decide for each entity

Force HTTPS and Non-WWW with .htaccess for CloudFlare Users

北城余情 提交于 2019-12-20 06:41:51
问题 I am using CloudFlare and I want to force HTTPS and Non-WWW by using .htaccess I know there are many examples online already, but for CloudFlare users, normal redirect may cause redirect loops. The closest answer is this one: https://stackoverflow.com/a/34065445/1254581 But it only force HTTPS and I need to force non-WWW too. Please help to edit this rules: RewriteEngine On # If we receive a forwarded http request from a proxy... RewriteCond %{HTTP:X-Forwarded-Proto} =http [OR] # ...or just a

PHP crawl a website, which is using cloudflare

最后都变了- 提交于 2019-12-19 04:14:53
问题 I want to crawl some specific values (e.g.newstext) from a website (which is not my own). file_get_contents() is not working, propably blocked by php.ini. So i tried to do it with curl, problem is: All I get is the redirection text from cloudflare. My crawler should do something like: go to page -> wait the 5secs cloudflare redirect -> curl the page. Any ideas how to crawl the page after the cloudfare waiting time? (in PHP) edit: so i tried a lot of things, problem is still the same.. more

Azure website IP restriction

為{幸葍}努か 提交于 2019-12-18 08:30:10
问题 I have an Azure website which I only use for development and testing, therefore I want to restrict access to it for everyone but myself. According to this blog article this is now offically supported, so I tried adding this to my web.config file: <system.webServer> <security> <ipSecurity allowUnlisted="false" denyAction="NotFound"> <add allowed="true" ipAddress="1.2.3.4" /> </ipSecurity> </security> </system.webServer> For the ipAddress attribute I have to use the IP address of my internet

Angular2 GZIP issue when I run my app

人走茶凉 提交于 2019-12-18 07:19:41
问题 I have an angular2 typescript app. I host with Firebase and use cloudflare for speed, caching and protection. The browser header says: accept-encoding:gzip, deflate, sdch, br This gets converted to a app.js file and is minified now to 1.6mb. I then GZIP Compressed this app.js file. I'm wanting to use the app.js file that is now GZIP compressed rather than the original 1.6mb app.js file. Therefore, I point to the app.js.gz file in my index.html page and I get a browser error called: app.js.gz

WordPress + CloudFront Flexible SSL ends up in redirect loop (https)

旧街凉风 提交于 2019-12-17 22:43:44
问题 Having problems accessing the admin over https when it's setup behind CloudFront Flexible SSL. The admin works fine when accessing over http, but as soon as I change to secure https it ends up in a redirect loop. I'm adding the following line to wp-config.php to force SSL in the admin. define('FORCE_SSL_ADMIN', true); 回答1: This is due to the fact that CloudFlare's Flexible SSL operates as a reverse proxy and connects to the WordPress installation via http . Wordpress thinks you're connecting

How to handle recaptcha on third-party site in my client application

一曲冷凌霜 提交于 2019-12-13 20:02:38
问题 I was curious about how people build third-party apps for sites with NO public APIs , but I could not really find any tutorials on this topic. So I decided to just give it a try. I created a simple desktop application, which uses HttpClient to send GET requests to the site I frequently use, and then parses the response and displays the data in my WPF window. This approach worked pretty well (probably because the site is fairly simple). However, today I tried to run my application from a

Can i use HTTP/2 between origin and cloudflare servers?(Apache)

时光总嘲笑我的痴心妄想 提交于 2019-12-13 16:31:28
问题 I try to do, but when i turn to bypass my domain A record, the protocol is h2 is working. All correct in browser and apache logs. When i turn on the cloudflare on the domain, the browser is working fine(I know the CF is working on HTTP2 protocol to clients). But i see in apache logs, “GET / HTTP/1.1” 302 5067 "GET /en/ HTTP/1.1" 200 5068 "POST /en/ajax/user HTTP/1.1" 200 77 Its using http/1.1, but i dont know why :) I try to set force http2 protocol using, but no difference. Any idea ?

Custom SSL doesn't show when using CloudFlare

☆樱花仙子☆ 提交于 2019-12-13 09:22:48
问题 I have certified SSL from godaddy. It works fine and the green address bar with the name of my company shows up when I use it without cloudflare. However when I change my dns to cloudflare and turn SSL Strict mode on, the green lock says I have SSL from cloud flare (it shows a different ssl certificate). I don't know what to do to still show my certified ssl in the address bar. 回答1: Here is the answer incase someone in future is having the same problem: EV certificates are only supported on

jQuery .css() doesn't work

谁都会走 提交于 2019-12-13 07:09:35
问题 I'm trying to change inline CSS using jQuery on my website. So far I have tried the following code: <script type="text/javascript"> jQuery(".shareaholic-share-button-container").css("background", "rgba(0,0,0,0)"); jQuery(".share-button-counter").css("background", "rgba(0,0,0,0)"); </script> I have also tried: <script type="text/javascript"> jQuery(document).ready(function(){ jQuery(init); function init() { jQuery(".shareaholic-share-button-container").css("background", "rgba(0,0,0,0)");