Apache/Nginx as proxy server?

AI-generated summary

kdiamond wants to install Discourse on a dedicated Ubuntu virtual machine and is considering using Apache or Nginx as a proxy server. They provided an Apache sample configuration and asked if it would work and if it’s good practice.

Falco replied that the configuration would work, but it’s not good practice most of the time. They explained that Discourse has a built-in Nginx configuration that supports features like brotli, http/2, and correct handling of client IPs, and adding another proxy could break these features.

Stephen asked kdiamond to clarify if the installation is for production or development, if it’s a local VM, and if they plan to give it a DNS name.

kdiamond thanked everyone for their replies and mentioned that they followed the Discourse installation guide.

Dear Discourse community. I have a question that I hope you can help me with.

I would like to install Discourse on a dedicated Ubuntu virtual machine (Oracle VirtualBox). example: 192.168.6.15.

I already have Apache2 and Nginx servers running on the same local network.

Could I just use a proxy like:

(apache sample)

<VirtualHost x.x.x.x:443>
ServerName forum.example.org
RewriteEngine On

SSLEngine On
SSLCertificateFile /etc/letsencrypt/live/forum.example.org/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/forum.example.org/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf

ProxyPreserveHost On
ProxyRequests Off
ProxyPass / http://192.168.6.15:4578/
ProxyPassReverse / http://192.168.6.15:4578/

</VirtualHost>

Would that work?
Is it good practice?
I guess let’s encrypt on a proxy server that will handle SSL?

Yes

Most of the time, no.

We already ship nginx inside the container, and we keep it configured and up to date with support for things brotli, http/2, non-buffering proxy, correct handling of client IPs, etc.

If you add a new proxy in the middle, then you are responsible for not breaking each of of those features.

  • Is this a production install for use, or a development install?
  • Will it be a local VM?
  • Will you be able to give it a name in DNS?

Thank you all for your reply.

I followed the steps in this guide and installed it.