Important: Discourse Single-Platform vs. Multi-Platform Environment

Single-Platform Environment Experience

Issue 1: Email Problem

Due to using an incorrect email, it took a very long time to find the code for email-free activation.

# Go to Discourse directory
sudo /var/discourse 

# Enter the app container
sudo ./launcher enter app

# Note: you'll be prompted to enter an email afterward. This email will be your account username by default,
# and the password must be 15 characters.
sudo rake admin:create

Issue 2: SSL Problem

When I first started learning, I didn’t understand that every time I set up from “new server” to “new Discourse installation”,

I had to reapply for “SSL certificates” each time without backing them up,

which eventually hit the rate limit (had to wait 1 week before I could apply again).

So not only did I not know what the problem was, but even after figuring it out, I was stuck waiting a full week before I could successfully set up.

Issue 3: Port Problem

During initial installation, it prompts about “port 80” and “port 443”.

Unable to access our configured “website domain,” which caused this issue and took a long time to troubleshoot.

Issue 4: Upload Size Limit

Problem cause: The upload file size limit set in the Discourse admin backend is ineffective.

Default limit: 10MB, and it cannot be adjusted…

Later I found out you need to configure the nginx server configuration file.

But actually!!! It’s a trap, can you believe it!!!

In single-platform mode, it uses Docker Engine’s prxxxxx (forgot the name) proxy mode to proxy NGINX.

I wasn’t sure if that was correct, but I found the cause by “listening” to see who was monitoring port 80, and tracked it down…

But actually, there were completely no tutorials on this anywhere online!!!

Summary: The upload file size limit equals unadjustable!!!

Difficulty Summary (Moderate)

Overall, these problems were still considered moderate. Compared to multi-platform issues,

they were incredibly much easier to deal with…

.

Multi-Platform Environment Experience

Issue 1: Reverse Proxy IP Address Entry

Originally, it wasn’t the IP address shown on the container…

It took me a long time to figure that out…

Input: 127.0.0.1:your configured port number

That’s all it takes…

Issue 2: Multi-Platform Not Worth It

I tried every possible way to set up a multi-platform environment.

The more I worked on it, the more I realized it was pointless!!!

Because I encountered so many problems, almost every time I had to

start all over again from “new server” to “forum installation.”

In the end, I just wanted to preserve my data—nothing else mattered.

It wasn’t until today (about a week later), luckily the SSL limit reset, and I could finally activate the “single-platform environment” again.

Also, during the process I discovered that the multi-platform environment I had imagined so beautifully

was actually completely unnecessary. Those幻想 multi-platform applications I had envisioned

along with the time invested and every little issue that caused reinstallation of the server

led me to realize: one server with one website is best.

At most, use subdomain prefixes to distinguish and redirect to other servers if needed.

For example: app downloads on one, forum on another; purely a forum that only manages forums; and resources on a separate download file server.

And this way, if any one has problems or usage gets too high, it won’t affect the other websites.

Issue 3: SSL Problem (Very Serious)

What a nightmare, this was the most frustrating!!!

First, let me explain: Discourse forums require SSL, meaning HTTPS is mandatory.

Experience Flow 1:

Used the “1panel panel” self-signed certificate, but found it didn’t work. Went through a lot of research during the process.

Experience Flow 2:

Used Alibaba Cloud free SSL, but their SSL homepage said they were out of stock.

I thought it was some kind of issue and just gave up and exited.

Then searched online for free SSL and found other providers.

Experience Flow 3

Found the “Cloudflare” DNS SSL provider.

Then went through all sorts of折腾. First went to Alibaba Cloud domain management center.

Changed the DNS解析 operator to “Cloudflare.”

Then went back to “Cloudflare” for各种折腾, got 2 files—the SSL certificates.

Later, not knowing how to upload SSL certificates, searched for more info.

Found something different (which ruined me), saying you only need to bind your account to the 1panel panel.

Then you can follow: apply for certificate → bind certificate → enable auto-renewal.

Normally, that’s considered complete, and indeed it was completed.

!!!

Experience Flow 4

But who would’ve thought, since the domain was on “Alibaba Cloud” and the “DNS” was on “Cloudflare,”

the IP addresses conflicted. Sometimes it was this current server’s IP, researched various solutions…

Sometimes it was the previous old server’s IP, researched various solutions…

Sometimes it was the “Cloudflare” proxy server’s IP, researched various solutions…

Sometimes it said no response, researched various solutions…

Sometimes it said “Cloudflare” was fine, the problem was my server, researched various solutions…

Sometimes it was the old server from two upgrades ago, researched various solutions…

Sometimes it said the SSL certificate was invalid, researched various solutions…

Sometimes it showed a 522 error page, researched various solutions…

Sometimes it showed a 502 error page, researched various solutions…

Sometimes it showed a 400 page error, researched various solutions…

Sometimes it said too many website redirects… hit the limit, researched various solutions…

!!!

In the end,

I could only keep opening the Windows command line window, constantly pinging my domain to check what my actual IP was.

Then I wondered if Alibaba Cloud and Cloudflare DNS were simultaneously interfering with my domain’s pointing address.

So I went to adjust the domain resolution on Alibaba Cloud side.

Then went to adjust the domain resolution on Cloudflare side.

!!!

Then all those previous problems repeated themselves…

!!!

Process + Conclusion

Then I saw on Cloudflare’s DNS resolution there were two modes: proxy mode and DNS pointing mode.

Proxy mode: User → opens website → goes through Cloudflare servers → my server.

DNS pointing mode: User → opens website → directly my server.

This is exactly the main reason for all the problems above!!!

“-> goes through Cloudflare servers” was the biggest cause of the IP jumping around, of course not the only cause!!!

There was too much, really exhausted!!!

Regardless of whether I use Discourse in the future, I will never again learn or set up one server with multiple websites.

Issue 4: Upload Size Limit

Besides the issue from the single-platform experience mentioned above,

here considering that 1panel panel needs to set up a reverse proxy,

you must install a web environment, meaning paired Nginx environment.

Here you can find the configuration file, and it’s quite simple, right near the website options.

But the problem is!!! The default setting there is a whopping 50MB!!!

But that damn Discourse still提示ed it could only upload the设定 value (which is a lie), then提示ed to use link方式 instead.

Later tried manually adjusting the Nginx configuration to see, but still crap, adjusting didn’t work either!!!

1 Like