Login failure in only one site in a multisite system

I have one Discourse main site with 6 more subsites added to it, each with distinctive domain and DB.

Initially, I copied the main site’s DB to keep the consistency, and it works fine with the other 5 subsites.

For only one site, whenever I try to login,

  • If it is via OIDC, I get “Sorry, the authorization timed out, or you have switched browsers. Please try again.” error on a blank screen
  • If it is ID/PW, I get “Unknown error” on top of the ID/PW box

I even have copied the DB from working one to the new one, but it does not work.

Below is the multisite config, in case it helps.

     oneexample:
       adapter: postgresql
       database: oneexample
       username: adminexample
       password: pwexample
       host: 192.168.1.1
       port: 5432
       pool: 25
       timeout: 5000
       db_id: 5
       host_names:
         - 1example.com

The reason I chose ‘oneexample’ and ‘1example’ is because the domain contains a number at front. My only suspicion so far is that the number creates the problem, because copying back the DB to a working site without a number in domain name works fine.

One may say that I should choose a different domain, but this one is kinda expensive paid domain, and I would like to make it working.

I have removed browser cookies, purged login logs from the DB, and also have tried with other domain with the same database. All worked fine.

One potential solution in my mind that I have not tested is change the domain to a subdomain, just to replace the number at the front of domain address, like

But, again, it loses the point of paying $$$ for this premium domain.

Do I look at the wrong place? Can there be any working solution?

tried with host_names: xxx.1example.com as well, but it gives the same error.

With the same database, I have successfully tried with a number of URLs without a number. It does seem related to the domain issue, but have no other clue.

From my Nginx’s location block,

proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-Forwarded-Port 443;
proxy_set_header X-Forwarded-Proto $scheme;

I have removed the last line, as its function duplicates with the first two lines. Somehow, it seems that Discourse saw the login comes from http, instead of https.

I’ve also added below line in the app.yml, just to make sure that Discourse does attempt to login via https, and finally it works.

  • DISCOURSE_FORCE_HTTPS: true

So the main question is, how did it work for the other 5 subsites?

you got me on this one