cloudflare

WebSocket connection failed: One or more reserved bits are on: reserved1 = 0, reserved2 = 1, reserved3 = 1

一笑奈何 提交于 2019-12-06 08:42:33
I am trying to setup WebSockets in my Javascript (React) application using Socket.io . When using the polling transport from the Socket.io client (v1.4.5), everything works fine. But I would like to use actual and secure WebSockets ( wss:// protocol)... My server is a Debian 7 running Nginx v1.2.1 as a proxy for my virtual hosts, and my Node.js app (using Socket.io v1.4.5). My domain name (api.tribeez.net) is set up via CloudFlare , which just announced full WebSocket support (including over SSL, i.e. wss:// ). When I start my app in Chrome (v50.0), I see the WebSocket connection in the

Serve non-subdomain routes

社会主义新天地 提交于 2019-12-06 08:07:34
I want to use Wordpress to host company's blog. Main website is an ASP app. They are hosted on different EC2 instances. Blog should have non-subdomain URL: example.com/blog , not blog.example.com . How can this be done? Can load-balancing tool like Cloudflare help with that? I tried doing some kind of masking using Route53. Also experimented with hosting the blog in IIS side-by-side with main site. You could put nginx upstream of both of them and use it as a reverse proxy to both of them matching the URL that is being targeted. A sample nginx config might look something like this: server {

Google Maps API 3 referrerNotAllowedMapError

a 夏天 提交于 2019-12-06 04:41:49
问题 I'm no stranger to Google Maps APi, and have used it for years...but I am stumped. I've installed an exact copy of the latest code sample from Google Maps Javascript API: Simple Map. I then confirmed both my browser and server keys from Google Developers Console, added the refer two different ways(see below). Code works when I set the referer to * wildcard in console, but cannot use that in production. Here's the skinny: tested using latest example code from Google Maps API Javascript (Simple

Cache-Control Headers not respected on CloudFlare

浪子不回头ぞ 提交于 2019-12-06 03:55:36
问题 I am trying to get some html pages to be cached, the same way images are automatically cached via CloudFlare but I can't get CloudFlare to actually hits its cache for html. According to the documentation (Ref: https://support.cloudflare.com/hc/en-us/articles/202775670-How-Do-I-Tell-CloudFlare-What-to-Cache-), it's possible to cache anything with a Cache-Control set to public with a max-age greater than 0. I've tried various combinations of headers on my origin Nginx server without success.

Cloudflare and Firebase

北慕城南 提交于 2019-12-06 03:55:05
Is it possible to use Cloudflare to reduce the stress on my firebase landing page? If so, how would I go about setting that up? This is a relatively new concept to me. This is possible but not recommended. Firebase Hosting is already served via a global CDN and is built to take on enormous scale. By using CloudFlare acceleration (using it just for DNS is perfectly fine) in front of Firebase Hosting you are likely to slow down your site by adding an extra proxy layer between the client and the content. 来源: https://stackoverflow.com/questions/47585071/cloudflare-and-firebase

In CloudFlare, present cached page only if cookie is not set

余生颓废 提交于 2019-12-06 00:53:50
I'm trying to prevent CloudFlare from hitting our servers if a user is not logged in, but instead to get the cached object if possible. We're setting a cookie ('email') if the user is logged in, and clearing it when the user is logged out. Is this possible? In order to do this you can use a feature called "Bypass Cache on Cookie". This allows you to specify a Regex string of what type of cookie you want to Bypass: When used in conjunction with a Cache Everything Page Rule, you can use this setting to cache anonymous page views but bypass the cache when a cookie exists. Further reading: Caching

Cloudflare Bad Gateway 502 error

微笑、不失礼 提交于 2019-12-05 21:04:03
问题 Myself and my users are often running into a Cloudflare Bad Gateway 502 error . Trying to figure out what goes wrong is hard, because Cloudflare blames the hosting company and the hosting company blames Cloudflare. A typical situation when using Cloudflare. What I noticed is that nothing actually fails. The host receives the request and is handling the request just fine but which sometimes takes a bit longer than usual to complete. But Cloudflare can't wait and instead throws a Bad Gateway

How should I set the real IP address when using CloudFlare, Heroku, and RoR?

这一生的挚爱 提交于 2019-12-05 13:40:43
I just recently started using CloudFlare and still have the lingering issue of getting CloudFlare's proxy IP addresses instead of my visitor's address. CloudFlare has many solutions for this, but I haven't seen any for Rails. I'm using Rails 3.2.17. It looks like if I initialize ActionDispatch::RemoteIp with the custom_proxies argument set to the proper regular expression that contains all of CloudFlare's IP ranges (along with all of the standard local and private ranges), it might solve my issue. Questions: 1) Is this the right approach? CloudFlare has a crap ton of IP ranges that all need to

How to use a variable in a CURL request with bash?

纵饮孤独 提交于 2019-12-05 10:24:33
Goal: I'm using a bash CURL script to connect to the Cloudflare APIv4. The goal is to update an A-record. My script: # Get current public IP current_ip=curl --silent ipecho.net/plain; echo # Update A record curl -X PUT "https://api.cloudflare.com/client/v4/zones/ZONEIDHERE/dns_records/DNSRECORDHERE" \ -H "X-Auth-Email: EMAILHERE" \ -H "X-Auth-Key: AUTHKEYHERE" \ -H "Content-Type: application/json" \ --data '{"id":"ZONEIDHERE","type":"A","name":"example.com","content":"'"${current_ip}"'","zone_name":"example.com"}' Problem: The current_ip variable is not printed when I call it in my script. The

Use CloudFlare to CDN a Google Cloud Storage Bucket

痞子三分冷 提交于 2019-12-05 09:17:30
I've heard many good things about Cloudflare, and they have an excellent CDN product that features functionality not found on competitors (HTTP2, IPv6 etc). I have files in a Google Cloud Storage bucket. How to set these files as the origin for a Cloudflare CDN? (The Cloudflare control panel seems to just want a website on a root domain...?) Maybe a bit late, but I put my answer just in case it is useful for someone else looking to do the same thing. I have a bucket in Google Cloud Storage behind CloudFlare. You just need to follow the instructions here: https://cloud.google.com/storage/docs