# Full site CDN acceleration for Discourse

**URL:** https://meta.discourse.org/t/full-site-cdn-acceleration-for-discourse/21467
**Category:** Self-Hosting
**Tags:** cdn, explanation
**Created:** [October 24, 2014, 6:17am UTC](https://meta.discourse.org/t/full-site-cdn-acceleration-for-discourse/21467 "2014-10-24T06:17:57Z")
**Posts on this page:** 1
**Showing post:** 11

<div class="post-metadata">

### Author: ![brahn](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/brahn/32/109267_2.png) [@brahn](https://meta.discourse.org/u/brahn)
#### Post date: [May 21, 2018, 2:46am UTC](https://meta.discourse.org/t/full-site-cdn-acceleration-for-discourse/21467/11 "2018-05-21T02:46:42Z")

</div>

> [@ryanerwin](#):
>
> The easiest way I’ve found to do this is to copy `templates/web.ssl.template.yml` to `local.web.ssl.template.yml` and just remove those extra lines

You can do this with a `- replace` in your app.yml similar to how it is described on [Setting up Let’s Encrypt with Multiple Domains](https://meta.discourse.org/t/setting-up-let-s-encrypt-with-multiple-domains/56685).

```plaintext
  after_ssl:
    - replace:
        filename: "/etc/nginx/conf.d/discourse.conf"
        from: /return 301 https.+/
        to: |
          return 301 https://$host$request_uri;

    - replace:
        filename: "/etc/nginx/conf.d/discourse.conf"
        from: /gzip on;[^\}]+\}/m
        to: |
          gzip on;
          add_header Strict-Transport-Security 'max-age=31536000'; # remember the certificate for a year and automatically connect to HTTPS for this domain

```

---

_[View the full topic](https://meta.discourse.org/t/full-site-cdn-acceleration-for-discourse/21467)._
