Error "We cannot detect if your account was created, please ensure you have cookies enabled"

AI-generated summary

A user, Eddyb, reports an issue with account registration on Discourse, receiving the error “We cannot detect if your account was created, please ensure you have cookies enabled,” along with a 403 error when using an invitation link. The user is on the latest version (2.4.0.beta9) and uses a reverse proxy with Nginx. codinghorror suggests a potential proxy configuration issue. Eddyb shares their Nginx configuration, questioning why only registration is affected. michaeld identifies the missing X-Forwarded-Proto header, which Eddyb confirms resolves the problem.

Hi, I’m stuck with this message “We cannot detect if your account was created, please ensure you have cookies enabled” whenever I try to register. I tried from different browser, different connections (wifi, 4g), from computer, smartphone…

If i try to register using an invitation link, I get a 403 error [“BAD CSRF”].

Except that everything is working, I can login using my admin account, create post etc.

I have a subfolder configuration, I’m using a reverse proxy from the main host to redirect every requests from /forum, my reverse proxy forward the IP address as excepted.

Are you on an old version of Discourse?

It’s likely your proxy config is broken.

I’m using the latest version (2.4.0.beta9) and my nginx configuration is:

location /forum {
    expires 1m;
    add_header Cache-Control "public";

    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Host $http_host;
    proxy_set_header X-NginX-Proxy true;

    resolver 127.0.0.11;
    set $forum "http://xxxxxx";
    proxy_pass $forum;
    proxy_intercept_errors on;

    proxy_redirect off;
    
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
}

Why is everything working except user registration if it’s a proxy config problem?

You need

proxy_set_header X-Forwarded-Proto https;

Thanks, X-Forwarded-Proto resolved the issue :slight_smile: