# Il callback OAuth HTTP viene richiesto anche se HTTPS è abilitato

**URL:** https://meta.discourse.org/t/http-oauth-calback-is-requested-even-if-https-is-enabled/30342
**Category:** Support
**Created:** [22 Giugno 2015, 11:23pm UTC](https://meta.discourse.org/t/http-oauth-calback-is-requested-even-if-https-is-enabled/30342 "2015-06-22T23:23:10Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![seanthegeek](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/seanthegeek/32/116327_2.png) [@seanthegeek](https://meta.discourse.org/u/seanthegeek)
#### Post date: [22 Giugno 2015, 11:23pm UTC](https://meta.discourse.org/t/http-oauth-calback-is-requested-even-if-https-is-enabled/30342/1 "2015-06-22T23:23:10Z")

</div>

I have HTTPS enabled on my site, enforced by a 301 redirect from HTTP to HTTPS by the reverse proxy in front of it. When I tried to login with Google, Google complained that the requested callback URL did not match the registered callback URL, the difference being that the registered callback URL uses HTTPS, and the requested URL uses HTTP..

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [22 Giugno 2015, 11:48pm UTC](https://meta.discourse.org/t/http-oauth-calback-is-requested-even-if-https-is-enabled/30342/2 "2015-06-22T23:48:10Z")

</div>

> [@seanthegeek](#):
>
> enforced by a 301 redirect from HTTP to HTTPS by the reverse proxy

That would be the cause, you need to ensure NGINX has the headers set correctly, when we need to enforce this we add:

```plaintext
 - replace:
         filename: /etc/nginx/conf.d/discourse.conf
         from: $thescheme;
         to: https;
         global: true

```

---

<div class="post-metadata">

### Author: ![seanthegeek](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/seanthegeek/32/116327_2.png) [@seanthegeek](https://meta.discourse.org/u/seanthegeek)
#### Post date: [23 Giugno 2015, 1:19am UTC](https://meta.discourse.org/t/http-oauth-calback-is-requested-even-if-https-is-enabled/30342/3 "2015-06-23T01:19:03Z")

</div>

Where does that go? I tried adding it `web_only.yml`, under

```
hooks:
  after_code:

```

And got

> Errno::ENOENT: No such file or directory - /etc/nginx/conf.d/discourse.conf

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [23 Giugno 2015, 1:23am UTC](https://meta.discourse.org/t/http-oauth-calback-is-requested-even-if-https-is-enabled/30342/4 "2015-06-23T01:23:41Z")

</div>

after\_web\_config:

> <https://github.com/discourse/discourse_docker/blob/master/templates/web.template.yml#L121>

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [8 Giugno 2024, 12:46pm UTC](https://meta.discourse.org/t/http-oauth-calback-is-requested-even-if-https-is-enabled/30342/5 "2024-06-08T12:46:06Z")

</div>

Questo argomento è stato chiuso automaticamente dopo 3273 giorni. Non sono più consentite nuove risposte.
