# Synapse (Matrix) via dynDNS

**URL:** https://dietpi.com/forum/t/synapse-matrix-via-dyndns/6231
**Category:** Troubleshooting
**Created:** [24 January 2022 06:47 UTC](https://dietpi.com/forum/t/synapse-matrix-via-dyndns/6231 "2022-01-24T06:47:32Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![schimy](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/s/f6c823/32.png) [@schimy](https://dietpi.com/forum/u/schimy)
#### Post date: [24 January 2022 06:47 UTC](https://dietpi.com/forum/t/synapse-matrix-via-dyndns/6231/1 "2022-01-24T06:47:32Z")

</div>

I tried to install Synapse on my Raspi yesterday. The installation itself went through without any problems. But I had difficulties to reach it via my DynDNS ([spdns.de](http://spdns.de)). I have released the ports 8008 and 8448 on my Fritzbox. Does anyone have an idea where the error is?

In [this message](https://dietpi.com/phpbb/search.php?author_id=7061&sr=posts) you announce a separate post about Synapse for the blog. Maybe this will help me when it is published?

Thanks,  
Schimy

---

<div class="post-metadata">

### Author: ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)
#### Post date: [24 January 2022 12:59 UTC](https://dietpi.com/forum/t/synapse-matrix-via-dyndns/6231/2 "2022-01-24T12:59:35Z")

</div>

Hi,

did you activate TLS configuration inside Synapse? Means you configured SSL certificate and activated HTTPS port?

---

<div class="post-metadata">

### Author: ![schimy](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/s/f6c823/32.png) [@schimy](https://dietpi.com/forum/u/schimy)
#### Post date: [24 January 2022 18:34 UTC](https://dietpi.com/forum/t/synapse-matrix-via-dyndns/6231/3 "2022-01-24T18:34:50Z")

</div>

Hi Joulinar,  
thx for your repliy

> [@](#):
>
> did you activate TLS configuration inside Synapse?

no, not knowingly. how do i have to do that?

> [@](#):
>
> Means you configured SSL certificate and activated HTTPS port?

yes, SSL via let’s encrypt and port 443 is active … for the whole pi

---

<div class="post-metadata">

### Author: ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)
#### Post date: [24 January 2022 21:36 UTC](https://dietpi.com/forum/t/synapse-matrix-via-dyndns/6231/4 "2022-01-24T21:36:58Z")

</div>

ok in this case it might be easier to reuse the existing web server as revers proxy. What web server you are running? And is it used for other web apps already?

---

<div class="post-metadata">

### Author: ![schimy](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/s/f6c823/32.png) [@schimy](https://dietpi.com/forum/u/schimy)
#### Post date: [25 January 2022 21:01 UTC](https://dietpi.com/forum/t/synapse-matrix-via-dyndns/6231/5 "2022-01-25T21:01:53Z")

</div>

> [@](#):
>
> What web server you are running? And is it used for other web apps already?

- Nginx as web server
- Nextcloud in a subdir
- let’s encrypt certificate  
everything installed via dietpi-software script  
dyndns: [spdns.de](http://spdns.de) installed manually

---

<div class="post-metadata">

### Author: ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)
#### Post date: [25 January 2022 23:11 UTC](https://dietpi.com/forum/t/synapse-matrix-via-dyndns/6231/6 "2022-01-25T23:11:18Z")

</div>

that’s pretty perfect as we could easily enable Nginx to work as revers proxy for Matrix. Do following

```nohighlight
nano /etc/nginx/sites-dietpi/matrix.conf

```

add following inside

```nohighlight
    location /_matrix {
      proxy_pass http://127.0.0.1:8008;
      proxy_set_header X-Forwarded-For $remote_addr;
      proxy_set_header X-Forwarded-Proto $scheme;
      client_max_body_size 50M;
    }

    location /.well-known/matrix/server {
      return 200 '{"m.server": "your.ddns.spdns.de:443"}';
      add_header Content-Type application/json;
    }

    location /.well-known/matrix/client {
      return 200 '{"m.homeserver": {"base_url": "https://your.ddns.spdns.de"}}';
      add_header Content-Type application/json;
      add_header "Access-Control-Allow-Origin" *;
    }

```

save and exit the file. Restart Nginx now

```nohighlight
systemctl restart nginx.service

```

Usually you should be able to reach Matrix via apps like Elemet. Custom URL would be simply [your.ddns.spdns.de](http://your.ddns.spdns.de)

This is based on this blog post [https://decatec.de/home-server/matrix-synapse-auf-ubuntu-server-20-04-lts-mit-nginx-postgresql-und-lets-encrypt/#Virtueller\_Host\_fuer\_Matrix\_Synapse](https://decatec.de/home-server/matrix-synapse-auf-ubuntu-server-20-04-lts-mit-nginx-postgresql-und-lets-encrypt/#Virtueller_Host_fuer_Matrix_Synapse)

---

<div class="post-metadata">

### Author: ![schimy](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/s/f6c823/32.png) [@schimy](https://dietpi.com/forum/u/schimy)
#### Post date: [27 January 2022 07:26 UTC](https://dietpi.com/forum/t/synapse-matrix-via-dyndns/6231/7 "2022-01-27T07:26:42Z")

</div>

Hi Joulinar

this works perfectly!!!

thx you very much for your fast and uncomplicated help 😃

---

<div class="post-metadata">

### Author: ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)
#### Post date: [27 January 2022 08:52 UTC](https://dietpi.com/forum/t/synapse-matrix-via-dyndns/6231/8 "2022-01-27T08:52:37Z")

</div>

perfect 🙂
