# How to run Discourse in Apache vhost, not Nginx

**URL:** <https://meta.discourse.org/t/how-to-run-discourse-in-apache-vhost-not-nginx/133112>\
**Category:** Self-hosting\
**Tags:** unsupported-install\
**Created:** [11 בנובמבר,‏ 2019,‏ 2:18pm UTC](https://meta.discourse.org/t/how-to-run-discourse-in-apache-vhost-not-nginx/133112 "2019-11-11T14:18:14Z")\
**Posts on this page:** 1\
**Showing post:** 26

<div class="post-metadata">

**Author:** ![marianord](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/marianord/32/90502_2.png) [@marianord](https://meta.discourse.org/u/marianord)\
**Post date:** [12 בנובמבר,‏ 2019,‏ 4:21pm UTC](https://meta.discourse.org/t/how-to-run-discourse-in-apache-vhost-not-nginx/133112/26 "2019-11-12T16:21:01Z")

</div>

I think this is an interesting discussion, just to get to know Discourse better.

I’d go with nginx, maybe modify the `app.yml` enough to add the `mod_security` module in the compiling process, and have _my own_ base image built.

Now, Discourse is a complex piece of software, that runs on Rails that is even more complex to deploy easily and consistently, that’s why the staff has gone the extra mile in the Docker image they make.

The image has a lot of blackmagic happening, with tons and tons of optimizations just to run as good as possible in the supported install.

Knowing that, and being able to get all the pieces of the puzzle figured out (like, the 2-3 repositories needed to have Discourse running). It isn’t impossible to get what you want runnig.

Now, Knowing that your setup is `nginx -> varnish -> apache`, why don’t you run `nginx -> varnish -> Discourse` having the `mod_security` added to the base image and setup with hooks.

---

_[View the full topic](https://meta.discourse.org/t/how-to-run-discourse-in-apache-vhost-not-nginx/133112)._
