# Discourse behind Varnish?

**URL:** <https://meta.discourse.org/t/discourse-behind-varnish/4864>\
**Category:** Self-hosting\
**Tags:** hosting\
**Created:** [March 18, 2013, 11:48am UTC](https://meta.discourse.org/t/discourse-behind-varnish/4864 "2013-03-18T11:48:24Z")\
**Posts on this page:** 1\
**Showing post:** 11

<div class="post-metadata">

**Author:** ![Lee\_Ars](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lee_ars/32/1597_2.png) [@Lee\_Ars](https://meta.discourse.org/u/Lee_Ars)\
**Post date:** [January 13, 2017, 9:19pm UTC](https://meta.discourse.org/t/discourse-behind-varnish/4864/11 "2017-01-13T21:19:05Z")

</div>

Quick update on this a year later: this is the Varnish 4.1/5 Discourse config I’ve been using that appears to work without any issues:

```plaintext
if (req.http.host ~"discourse.bigdinosaur.org") {
   if (!(req.url ~ "(^/uploads/|^/assets/|^/user_avatar/)" )) {
      return (pass);
   }
}

```

Could probably also tweak it a bit, since it’s ignoring and not caching some emoji (specifically emojii with query strings on the end of their URLs) and a couple of other things (scripts, css). But it works!

edit - this is in `sub vcl_recv`, obviously.

---

_[View the full topic](https://meta.discourse.org/t/discourse-behind-varnish/4864)._
