By dashan
I want to confirm the operation process. First, connect to my server and complete the corresponding steps according to the discourse prompt. Then, if you cannot access the website, you need to download nginx or apache (download any one). I installed nginx according to this operation but an error occurred. What should I do next?
https://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-ubuntu-20-04
root@discourse:~# sudo ufw allow ‘Nginx HTTP’
Rule added
Rule added (v6)
root@discourse:~# sudo ufw allow ‘Nginx HTTPS’
Rule added
Rule added (v6)
root@discourse:~# sudo ufw status
Status: active
To Action From
22/tcp LIMIT Anywhere
80/tcp ALLOW Anywhere
443 ALLOW Anywhere
Nginx HTTP ALLOW Anywhere
Nginx HTTPS ALLOW Anywhere
22/tcp (v6) LIMIT Anywhere (v6)
80/tcp (v6) ALLOW Anywhere (v6)
443 (v6) ALLOW Anywhere (v6)
Nginx HTTP (v6) ALLOW Anywhere (v6)
Nginx HTTPS (v6) ALLOW Anywhere (v6)
root@discourse:~# systemctl status nginx
× nginx.service - A high performance web server and a reverse proxy server
Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset:>
Active: failed (Result: exit-code) since Wed 2025-09-24 19:41:30 UTC; 2min>
Docs: man:nginx(8)
CPU: 13ms
lines 1-5/5 (END)
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hey,
Looking at your output, nginx is failing to start. This is a common issue when Discourse is already using ports 80 and 443, which nginx also needs. Here’s how to diagnose and fix this:
sudo netstat -tlnp | grep ':80\|:443'
or
sudo ss -tlnp | grep ':80\|:443'
sudo journalctl -u nginx.service -l --no-pager
or
sudo tail -f /var/log/nginx/error.log
sudo docker ps
If Discourse is already running and using ports 80/443: You don’t actually need nginx! Discourse’s built-in reverse proxy handles this. Try accessing your site directly with your domain/IP.
If you still want to use nginx as a reverse proxy:
cd /var/discourse
sudo ./launcher stop app
sudo systemctl start nginx
sudo systemctl status nginx
Quick test - try accessing your site: Before making changes, try visiting your domain in a browser. If Discourse installed correctly, it might already be working without nginx.
What do you see when you run the diagnostic commands above? This will help determine the exact issue.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.