cloudflare

Get correct visitor IP through CloudFlare

…衆ロ難τιáo~ 提交于 2019-12-24 03:30:13
问题 I'm using cPanel from someone else who resold it to me. This will probably mean I cannot use mod_cloudflare I would like to get the visitor's IP and not CloudFlare IP. The part of code I'm using: $_SERVER['REMOTE_ADDR'] That line will get the IP of cloud flare and not the original user's IP. Is there any way I can get the original IP address from the visitor? 回答1: Yes, but without access to the server configuration, you will be unable to utilize $_SERVER['REMOTE_ADDR'] . However, you can

Redirect loop when activating CloudFlare

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-23 08:57:30
问题 I am trying to put my website behind CloudFlare but unfortunately when I activate CloudFlare I start getting a redirect loop (I am using Chrome). I have tried to clear the cookies, as recommended, but it does not solve the issue and I am not having this issue when CloudFlare is not activated. What is causing this and how to solve it in my node.js application? 回答1: Apparently, this was a configuration issue. I was on Flexible SSL and changed it to full SSL. My node.js app was receiving HTTP

cloudfront cache hits only pricing

浪尽此生 提交于 2019-12-23 05:14:23
问题 lets say i am using aws's s3 connected with cloudfront . And s3 sends one image file of size 1 MB to be cached on all cloudfront's edge nodes. then the cached image file is downloaded 1 million times from cloudfront's edges .(the image is not grabbed again from s3 ). do i pay for 1-the bandwidth for transferring the file from s3 to cloudfront edges. 2- the bandwidth for transferring the file from s3 to cloudfront edges + the bandwidth for 1 million downloads from the cloudfront edges . also ,

Reverse proxy same naked domain to different hosts

女生的网名这么多〃 提交于 2019-12-23 02:54:11
问题 I'm managing the DNS of my domain with Cloudflare. The marketing pages for are hosted with Netlify. The main application is hosted with Heroku. Is it possible with cloudflare + a naked domain (my-example.com) to have some paths being served by Netlify and other paths by Heroku? Or am I forced to put one of the hosting services on a subdomain? 回答1: Disclaimer: I work for Netlify. You can definitely do this without running your own server or paying anything extra. Since Netlify already has a

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

点点圈 提交于 2019-12-23 01:27:13
问题 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

Why is express session cookie being blocked as a third party cookie

血红的双手。 提交于 2019-12-22 18:22:10
问题 I am using the express-session module, it works perfectly on localhost but on my website (hosted on Heroku using Cloudflare), the express session is being blocked as being a third party cookie. Here is the configuration for my session: app.use(session({ resave: false, saveUninitialized: false, proxy : true, cookie: { maxAge: 3600000000000, httpOnly: false, secure: false, domain: '.mydomain.com', path: '/' }, store: sessionStore, secret: 'mysecret', unset: 'destroy' })); Is this an issue with

Serve non-subdomain routes

故事扮演 提交于 2019-12-22 12:32:07
问题 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. 回答1: You could put nginx upstream of both of them and use it as a reverse proxy to both of them

How to prevent exposing origin IP address on Cloudflare?

爷,独闯天下 提交于 2019-12-22 01:48:37
问题 On Cloudflare DNS setting page it state that An A, AAAA, CNAME, or MX record is pointed to your origin server exposing your origin IP address. I have an MX record on my domain pointing to mail.mydomain.com . I believe it is something needed for the mail to work. How can I prevent it from exposing my origin IP address? 回答1: CloudFlare forwards your traffic through their network by replacing the IP in DNS records with CloudFlare's IP. This process works well in all situation except mail servers

Get Cloudflare's HTTP_CF_IPCOUNTRY header with javascript?

眉间皱痕 提交于 2019-12-21 04:55:24
问题 There are many SO questions how to get http headers with javascript, but for some reason they don't show up HTTP_CF_IPCOUNTRY header. If I try to do with php echo $_SERVER["HTTP_CF_IPCOUNTRY"]; , it works, so CF is working just fine. Is it possible to get this header with javascript? 回答1: Assuming you are talking about client side JavaScript: no, it isn't possible. The browser makes an HTTP request to the server. The server notices what IP address the request came from The server looks up

Determine if visitor connected over SSL on CloudFlare Pro [closed]

为君一笑 提交于 2019-12-20 20:38:16
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . We have a site running on CloudFlare Pro that uses their supplied certificate for one-click encryption. Our site has "optional" SSL for users. As it's a forum, we currently run a proxy script that detects if a posted image is not using a HTTPS protocol and automatically proxies the image through a script running