The IP addresses obtained by all Discourse users are actually the IP addresses of CloudFlare’s servers.
Modification
Fortunately, Discourse has already provided a solution.
You need to add the following content to Discourse’s configuration file:
“templates/cloudflare.template.yml”
Then rebuild your Discourse installation instance.
./launcher rebuild app
The above command can be used to directly rebuild Discourse. It should be noted that the rebuild takes about 10 minutes, during which the system is inaccessible.
Refresh the system again to check, and the system can now obtain the correct IP address.
Boss, is this using CloudFlare’s CDN proxy acceleration? Why am I always getting a 502 error from CloudFlare to the origin server? It occasionally works. The origin server is in China. Is it a network issue, an SSL certificate issue, or are there any CloudFlare configurations to pay attention to?
The problem has been found. I was using TCP load balancing for internal forwarding and it was not configured correctly. It has since been fixed. However, the origin server is in China, and using CloudFlare actually made it slower. I have now abandoned CloudFlare. Internal forwarding also involves parsing the user IP address, which was resolved using real_ip_header proxy_protocol.
There are ICP filing issues. If it is a domestic server, there are no filing issues. Using Tencent’s full-site data acceleration may be better than CloudFlare.
The filing has been processed. I tried Alibaba’s, and the acceleration is fine, but it’s quite expensive. How is Tencent’s pricing? Cloudflare is free.
I switched to ubuntu22.04 and it’s still giving the same error
FAILED
Pups::ExecError: /tmp/add-cloudflare-ips failed with return #<Process::Status: pid 4279 exit 8>
Location of failure: /usr/local/lib/ruby/gems/3.2.0/gems/pups-1.2.1/lib/pups/exec_command.rb:132:in `spawn’
exec failed with the params “/tmp/add-cloudflare-ips”
bootstrap failed with exit code 8
** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one.
./discourse-doctor may help diagnose the problem.
Pups::ExecError: /tmp/add-cloudflare-ips failed with return #<Process::Status: pid 5134 exit 8>
Location of failure: /usr/local/lib/ruby/gems/3.2.0/gems/pups-1.2.1/lib/pups/exec_command.rb:132:in `spawn’
exec failed with the params “/tmp/add-cloudflare-ips”
bootstrap failed with exit code 8
** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one.
./discourse-doctor may help diagnose the problem.
f51291d274ba2564076ba412f28fb445db9c916f00a6d1fb76d2613e773ccfcf
I don’t know what’s going on!!!