# Issues with force https, proxy and invitations

**URL:** <https://meta.discourse.org/t/issues-with-force-https-proxy-and-invitations/153995>\
**Category:** Product Support\
**Created:** [June 5, 2020, 10:16pm UTC](https://meta.discourse.org/t/issues-with-force-https-proxy-and-invitations/153995 "2020-06-05T22:16:45Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![Felip](https://avatars.discourse-cdn.com/v4/letter/f/d9b06d/32.png) [@Felip](https://meta.discourse.org/u/Felip)\
**Post date:** [June 5, 2020, 10:16pm UTC](https://meta.discourse.org/t/issues-with-force-https-proxy-and-invitations/153995/1 "2020-06-05T22:16:45Z")

</div>

My Discourse instance is behind a proxy:

```plaintext
server {
    server_name forum.[...];

    location / {
        proxy_pass http://IP_ADDRESS;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_redirect off;

    }

    client_max_body_size 10m;

    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/forum.[...]/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/forum.[...]/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

}
server {
    if ($host = forum.[...]) {
        return 301 https://$host$request_uri;
    } # managed by Certbot

    server_name forum.smbcn.org;

    listen 80;
    return 404; # managed by Certbot

}

```

Which leads to the server Discourse is installed on (standard Docker installation):

```plaintext
server {
        listen 80; listen [::]:80;
        server_name forum.[...];

        client_max_body_size 10m;

        location / {
                proxy_pass http://unix:/var/discourse/shared/standalone/nginx.http.sock:;
                proxy_set_header Host $http_host;
                proxy_http_version 1.1;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header X-Forwarded-Proto $scheme;
                proxy_set_header X-Real-IP $remote_addr;
        }
}

```

When I force HTTPS, invited users cannot proceed to registration. Browser logs show a 403 error (bad CSRF), even though a CSRF token was successfully generated. Invitations work just fine when HTTPS is not forced.

I guess something is wrong with the way I proxy HTTPS requests to HTTP, maybe some missing headers?

---

_[View the full topic](https://meta.discourse.org/t/issues-with-force-https-proxy-and-invitations/153995)._
