# هل لا يتعرف Discourse على وسم X-Forwarded-For للوكيل؟

**URL:** <https://meta.discourse.org/t/x-forwarded-for-proxy-tag-not-recognized-by-discourse/77961>\
**Category:** Self-hosting\
**Created:** [13 يناير 2018، 10:35م UTC](https://meta.discourse.org/t/x-forwarded-for-proxy-tag-not-recognized-by-discourse/77961 "2018-01-13T22:35:45Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![Anil\_Gupta](https://avatars.discourse-cdn.com/v4/letter/a/58956e/32.png) [@Anil\_Gupta](https://meta.discourse.org/u/Anil_Gupta)\
**Post date:** [13 يناير 2018، 10:35م UTC](https://meta.discourse.org/t/x-forwarded-for-proxy-tag-not-recognized-by-discourse/77961/1 "2018-01-13T22:35:46Z")

</div>

**Our Set Up**

1. Discourse is installed on Google Compute VM machine with no SSL certificates on this server.  
**Force\_https** discourse setting is set to true (checked to force https).

2. We have the front end running with ‘Google Load Balancer’ with **HTTPS certificate** attached at Load balancer level.

3. Google Oauth credentials settings has both **http** and **https** callback URL’s set up.

4. User Request [HTTPS.www.truvisa.com](http://HTTPS.www.truvisa.com) → Google Load balancer **→ HTTP** Discourse on Google Compute engine.

- The [https://www.truvisa.com](https://www.truvisa.com) URL works fine.
- User tries to log-in with Google OAuth. Works fine and user is logged in.

**Problem:**

User Request **HTTP** → Google Load balancer → **HTTP** Discourse on Google Compute engine.  
The **[http://www.truvisa.com](http://www.truvisa.com)** url works fine. We actually expected this to be redirected to HTTPs (as we have force https enabled), but it did not work.

- User tries to log-in with Google OAuth. User cannot log-in.
- CSRF error is thrown by Google o-Auth
- ![image](https://global.discourse-cdn.com/meta/original/3X/5/6/56e8a74ede2f058d77328d4ebcbc491051988ede.png)

**What we think is happening:**  
I searched through the discourse forum for a solution and understand that Google load balancer (a proxy in our case) need to send the **X-Forwarded-Proto** header for discourse to redirect the http request to https version.

Google load balancer does send this **X-Forwarded-Proto** to discourse installation server.

**My question:**  
Is there anything that needs to be changed in Discourse set up anywhere to make this work?  
Are we missing any kind of redirection from **http to https** setting in default discourse install?

Please help.

---

_[View the full topic](https://meta.discourse.org/t/x-forwarded-for-proxy-tag-not-recognized-by-discourse/77961)._
