# כיצד אוכל לעדכן את תצורת ה-nginx ישירות ב-discourse/docker ..?

**URL:** https://meta.discourse.org/t/how-can-i-update-the-nginx-config-directly-in-discourse-docker/264011
**Category:** Self-hosting
**Tags:** docker, nginx
**Created:** [5 במאי,‏ 2023,‏ 8:11pm UTC](https://meta.discourse.org/t/how-can-i-update-the-nginx-config-directly-in-discourse-docker/264011 "2023-05-05T20:11:50Z")
**Posts on this page:** 1
**Showing post:** 4

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [6 במאי,‏ 2023,‏ 4:35pm UTC](https://meta.discourse.org/t/how-can-i-update-the-nginx-config-directly-in-discourse-docker/264011/4 "2023-05-06T16:35:53Z")

</div>

You might find a similar technique to edit the config in this old advice works for you:

(taken from a prior version of this wiki post: [Set up Let’s Encrypt with multiple domains / redirects](https://meta.discourse.org/t/set-up-let-s-encrypt-with-multiple-domains/56685))

"It’s pretty simple really, add something like the following to your `app.yml` hooks section:

## Step 2 - discourse.conf

In addition to step 1 there is a change needed for nginx to correctly redirect http to https for anything other than `DISCOURSE_HOSTNAME`

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

```

We also need to remove the additional rewrite that [`web.ssl.template.yml`](https://github.com/discourse/discourse_docker/blob/master/templates/web.ssl.template.yml#L39) adds since it forces only the `DISCOURSE_HOSTNAME` and now we have others!

```plaintext
    - 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/how-can-i-update-the-nginx-config-directly-in-discourse-docker/264011)._
