# Security tab shows me a different location due to Cloudflare

**URL:** https://meta.discourse.org/t/security-tab-shows-me-a-different-location-due-to-cloudflare/104410
**Category:** Support
**Created:** [12월 16, 2018, 12:03오후 UTC](https://meta.discourse.org/t/security-tab-shows-me-a-different-location-due-to-cloudflare/104410 "2018-12-16T12:03:21Z")
**Posts on this page:** 18
**Page:** 1

<div class="post-metadata">

### Author: ![Pravi](https://avatars.discourse-cdn.com/v4/letter/p/76d3ee/32.png) [@Pravi](https://meta.discourse.org/u/Pravi)
#### Post date: [12월 16, 2018, 12:03오후 UTC](https://meta.discourse.org/t/security-tab-shows-me-a-different-location-due-to-cloudflare/104410/1 "2018-12-16T12:03:21Z")

</div>

Hello guys,  
Why it shows my location as the UK while I am in India? Am I missing something in the settings?

 ![location](https://global.discourse-cdn.com/meta/original/3X/0/9/0978080fba22858e538bd410559ff43948b3f27b.png)

---

<div class="post-metadata">

### Author: ![fhe](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fhe/32/113345_2.png) [@fhe](https://meta.discourse.org/u/fhe)
#### Post date: [12월 16, 2018, 12:05오후 UTC](https://meta.discourse.org/t/security-tab-shows-me-a-different-location-due-to-cloudflare/104410/2 "2018-12-16T12:05:26Z")

</div>

Are you using some kind of VPN? I think the Location is based on the IP that is used for the particular login.

---

<div class="post-metadata">

### Author: ![Pravi](https://avatars.discourse-cdn.com/v4/letter/p/76d3ee/32.png) [@Pravi](https://meta.discourse.org/u/Pravi)
#### Post date: [12월 16, 2018, 12:11오후 UTC](https://meta.discourse.org/t/security-tab-shows-me-a-different-location-due-to-cloudflare/104410/3 "2018-12-16T12:11:49Z")

</div>

No I am not using any VPN service. But I am using cloudflare for my site. Is that a problem?

---

<div class="post-metadata">

### Author: ![fhe](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fhe/32/113345_2.png) [@fhe](https://meta.discourse.org/u/fhe)
#### Post date: [12월 16, 2018, 12:20오후 UTC](https://meta.discourse.org/t/security-tab-shows-me-a-different-location-due-to-cloudflare/104410/4 "2018-12-16T12:20:45Z")

</div>

I don’t know if Cloudflare is affecting the lookup. Discourse is using MaxMind, so you can try for yourself by entering your IP address at

> **[GeoIP web services demo | MaxMind](https://www.maxmind.com/en/geoip-web-services-demo)**
>
> Demo MaxMind’s GeoIP web services by entering up to 25 IP addresses. Instantly
> access IP geolocation and IP intelligence data.

---

<div class="post-metadata">

### Author: ![Pravi](https://avatars.discourse-cdn.com/v4/letter/p/76d3ee/32.png) [@Pravi](https://meta.discourse.org/u/Pravi)
#### Post date: [12월 16, 2018, 12:45오후 UTC](https://meta.discourse.org/t/security-tab-shows-me-a-different-location-due-to-cloudflare/104410/5 "2018-12-16T12:45:28Z")

</div>

Maxmind shows my exact location. Seems like Cloudflare datacenters issue to me, but not sure.

 ![Screenshot%20from%202018-12-16%2018-05-04](https://global.discourse-cdn.com/meta/original/3X/e/3/e3dec1dca5cb955ef5f38feb2051088958b254d3.png)

---

<div class="post-metadata">

### Author: ![itsbhanusharma](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/itsbhanusharma/32/180717_2.png) [@itsbhanusharma](https://meta.discourse.org/u/itsbhanusharma)
#### Post date: [12월 16, 2018, 1:07오후 UTC](https://meta.discourse.org/t/security-tab-shows-me-a-different-location-due-to-cloudflare/104410/6 "2018-12-16T13:07:42Z")

</div>

So Your site is behind cloudflare?

---

<div class="post-metadata">

### Author: ![Pravi](https://avatars.discourse-cdn.com/v4/letter/p/76d3ee/32.png) [@Pravi](https://meta.discourse.org/u/Pravi)
#### Post date: [12월 16, 2018, 1:17오후 UTC](https://meta.discourse.org/t/security-tab-shows-me-a-different-location-due-to-cloudflare/104410/7 "2018-12-16T13:17:48Z")

</div>

Yes..for almost 1 year without any problem.

---

<div class="post-metadata">

### Author: ![itsbhanusharma](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/itsbhanusharma/32/180717_2.png) [@itsbhanusharma](https://meta.discourse.org/u/itsbhanusharma)
#### Post date: [12월 16, 2018, 1:19오후 UTC](https://meta.discourse.org/t/security-tab-shows-me-a-different-location-due-to-cloudflare/104410/8 "2018-12-16T13:19:04Z")

</div>

Did You include the cloudflare template in your yml file?

---

<div class="post-metadata">

### Author: ![gerhard](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gerhard/32/119479_2.png) [@gerhard](https://meta.discourse.org/u/gerhard)
#### Post date: [12월 16, 2018, 1:41오후 UTC](https://meta.discourse.org/t/security-tab-shows-me-a-different-location-due-to-cloudflare/104410/9 "2018-12-16T13:41:10Z")

</div>

I don’t think it has anything to do with Cloudflare, but just to be sure, can you go to your profile and look at the list of last used devices? The locations in that list have a tooltip with the IP address. Is it showing the correct IP address?

My guess is that the MaxMind DB with IP addresses is out of date. You could try rebuilding the container.

@nbianca Correct me if I’m wrong, but I believe there is no background job for regularly updating that database and I’m not sure if Discourse picks up the changes when the `maxminddb:get` rake task is executed without a restart.

---

<div class="post-metadata">

### Author: ![Pravi](https://avatars.discourse-cdn.com/v4/letter/p/76d3ee/32.png) [@Pravi](https://meta.discourse.org/u/Pravi)
#### Post date: [12월 16, 2018, 2:15오후 UTC](https://meta.discourse.org/t/security-tab-shows-me-a-different-location-due-to-cloudflare/104410/10 "2018-12-16T14:15:09Z")

</div>

This is what’s shown in my profile. Why is it showing Singapore? 🥶

 ![security](https://global.discourse-cdn.com/meta/original/3X/b/f/bf5ac8fb23732076381bc9e58837ff944d7ea3dc.png)

When I click on the log out all, my session was logged out and I have to login again.  
Tried rebuilding the app, then logged out and log in again, but still the same.

---

<div class="post-metadata">

### Author: ![Pravi](https://avatars.discourse-cdn.com/v4/letter/p/76d3ee/32.png) [@Pravi](https://meta.discourse.org/u/Pravi)
#### Post date: [12월 16, 2018, 2:16오후 UTC](https://meta.discourse.org/t/security-tab-shows-me-a-different-location-due-to-cloudflare/104410/11 "2018-12-16T14:16:52Z")

</div>

No, I haven’t included the cloudflare template in yml file.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [12월 16, 2018, 2:59오후 UTC](https://meta.discourse.org/t/security-tab-shows-me-a-different-location-due-to-cloudflare/104410/12 "2018-12-16T14:59:33Z")

</div>

Did the ip address that Discourse reports match your ip address? It is likely that Discourse is seeing the address of the cloudflare data center that is requesting the data. See if your logs are correctly logging up address or only those of cloudflare data centers.

---

<div class="post-metadata">

### Author: ![nbianca](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nbianca/32/157984_2.png) [@nbianca](https://meta.discourse.org/u/nbianca)
#### Post date: [12월 16, 2018, 3:22오후 UTC](https://meta.discourse.org/t/security-tab-shows-me-a-different-location-due-to-cloudflare/104410/13 "2018-12-16T15:22:59Z")

</div>

Hey,

This could be a problem with MaxMindDb (old or not precise) or Cloudflare.

To rule out Cloudflare, can you please check if the IP shown in the admin panel (Admin \> Users \> your username) under “Last IP Address” matches your real IP? If yes, it might be a problem with MaxMindDb being too old.

> [@gerhard](#):
>
> @nbianca Correct me if I’m wrong, but I believe there is no background job for regularly updating that database and I’m not sure if Discourse picks up the changes when the `maxminddb:get` rake task is executed without a restart.

Yes, that is true. There is no background job for regularly updating the database or hot-reloading the MaxMindDb.

---

<div class="post-metadata">

### Author: ![Pravi](https://avatars.discourse-cdn.com/v4/letter/p/76d3ee/32.png) [@Pravi](https://meta.discourse.org/u/Pravi)
#### Post date: [12월 16, 2018, 3:45오후 UTC](https://meta.discourse.org/t/security-tab-shows-me-a-different-location-due-to-cloudflare/104410/14 "2018-12-16T15:45:15Z")

</div>

> [@pfaffman](#):
>
> Did the ip address that Discourse reports match your ip address?

> [@nbianca](#):
>
> To rule out Cloudflare, can you please check if the IP shown in the admin panel (Admin \> Users \> your username) under “Last IP Address” matches your real IP?

No, my IP is not matching the one shown in discourse. So it’s more like a discourse problem, right?

 ![ip](https://global.discourse-cdn.com/meta/original/3X/9/e/9e4c48fad9311a97a27ab8cfcce66f03974f4f67.png)

---

<div class="post-metadata">

### Author: ![gerhard](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gerhard/32/119479_2.png) [@gerhard](https://meta.discourse.org/u/gerhard)
#### Post date: [12월 16, 2018, 4:03오후 UTC](https://meta.discourse.org/t/security-tab-shows-me-a-different-location-due-to-cloudflare/104410/15 "2018-12-16T16:03:47Z")

</div>

No, it’s a configuration problem.

> [@Pravi](#):
>
> No, I haven’t included the cloudflare template in yml file.

You really should follow the steps in [Full site CDN acceleration for Discourse](https://meta.discourse.org/t/full-site-cdn-acceleration-for-discourse/21467) in order to get a working Cloudflare setup.

---

<div class="post-metadata">

### Author: ![Pravi](https://avatars.discourse-cdn.com/v4/letter/p/76d3ee/32.png) [@Pravi](https://meta.discourse.org/u/Pravi)
#### Post date: [12월 16, 2018, 4:53오후 UTC](https://meta.discourse.org/t/security-tab-shows-me-a-different-location-due-to-cloudflare/104410/16 "2018-12-16T16:53:52Z")

</div>

I didn’t get most of the part mentioned in that link. Can you tell me what exactly I have to do get maximum out of my free Cloudflare account? What changes do I have to make?

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [12월 16, 2018, 5:23오후 UTC](https://meta.discourse.org/t/security-tab-shows-me-a-different-location-due-to-cloudflare/104410/17 "2018-12-16T17:23:01Z")

</div>

Follow the link already provided above.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [12월 16, 2018, 5:23오후 UTC](https://meta.discourse.org/t/security-tab-shows-me-a-different-location-due-to-cloudflare/104410/18 "2018-12-16T17:23:04Z")

</div>


