From ff4aaa04cb4da70cc7fcfb4b93bcaeac5b58b8d7 Mon Sep 17 00:00:00 2001 From: Richard Phillips Date: Thu, 14 Mar 2013 12:18:56 +0000 Subject: [PATCH] Apache2 Configuration Sample Sample Virtualhost showing how to:proxy requests to thinserver cluster, Server static files locally, set headers for downstream server to cache static assets, exclude mod_security rules that interfere with Discourse. --- config/apache2.conf.sample | 49 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 config/apache2.conf.sample diff --git a/config/apache2.conf.sample b/config/apache2.conf.sample new file mode 100644 index 00000000000..dca63012d10 --- /dev/null +++ b/config/apache2.conf.sample @@ -0,0 +1,49 @@ +# Apache2 Virtual Host file to proxy Discourse to Thin cluster + + +ServerName forum.example.org.uk +DocumentRoot /html/discourse/public/ +LogLevel debug +# ErrorLog /html/discourse/log/error.log +# CustomLog /html/discourse/log/access.log combined + +# Hide some server information, since we can.. +Header set Server "Sample Server Name" + + + SecRuleEngine On + # Remove any rules that prevent Discourse from running at all + SecRuleRemoveById + + + + Require all granted + + + + # Set caching headers here, providing advice to downstream cache + Header set Cache-Control "public, max-age = 604800" + + + RewriteEngine On + + + BalancerMember http://127.0.0.1:3000 + BalancerMember http://127.0.0.1:3001 + BalancerMember http://127.0.0.1:3002 + + + # Prevent requests for /assets from being passed upstream + ProxyPass /assets ! + + # Pass the everything else + ProxyPass / balancer://thinservers/ + ProxyPassReverse / balancer://thinservers/ + ProxyPreserveHost on + + + Require all granted + + + +