# HTTPS (TLS) behind Apache reverse proxy

**URL:** https://forum.syncthing.net/t/https-tls-behind-apache-reverse-proxy/3097
**Category:** General
**Created:** [June 23, 2015, 7:45pm UTC](https://forum.syncthing.net/t/https-tls-behind-apache-reverse-proxy/3097 "2015-06-23T19:45:58Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![alexxtasi](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/a/f14d63/32.png) [@alexxtasi](https://forum.syncthing.net/u/alexxtasi)
#### Post date: [June 23, 2015, 6:06pm UTC](https://forum.syncthing.net/t/https-tls-behind-apache-reverse-proxy/3097/1 "2015-06-23T18:06:42Z")

</div>

Hi first time I use this feature (almost a year after !) But having already configured the [Reverse Proxy Setup](http://docs.syncthing.net/users/reverseproxy.html#server-configuration) for the apache server, when I check the “Use HTTPS for GUI” the apache setup breaks.

I modified it a bit so it works:

```
LoadModule ssl_module modules/mod_ssl.so
SSLProxyEngine On
SSLCertificateFile /path-to/.config/syncthing/https-cert.pem
SSLCertificateKeyFile /path-to/.config/syncthing/https-key.pem
ProxyPass /syncthing/ https://127.0.0.1:8080/
<Location /syncthing/>
        ProxyPassReverse https://127.0.0.1:8080/
        #Require all granted - not for apache v2.2.15
        Allow from all
</Location>

```

Now when I hit `http://server-ip/syncthing/` I can see syncthing’s web gui, but having no `https` indicator…

Since I am just a newbie, is this configuration correct and also secure?

thanks

---

<div class="post-metadata">

### Author: ![calmh](https://forum.syncthing.net/user_avatar/forum.syncthing.net/calmh/32/15311_2.png) [@calmh](https://forum.syncthing.net/u/calmh)
#### Post date: [June 23, 2015, 6:22pm UTC](https://forum.syncthing.net/t/https-tls-behind-apache-reverse-proxy/3097/2 "2015-06-23T18:22:04Z")

</div>

No. You’re talking insecure HTTP between yourself and Apache and HTTPS between Apache and Syncthing. You need to use an HTTPS URL in your browser.

---

<div class="post-metadata">

### Author: ![alexxtasi](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/a/f14d63/32.png) [@alexxtasi](https://forum.syncthing.net/u/alexxtasi)
#### Post date: [June 23, 2015, 7:40pm UTC](https://forum.syncthing.net/t/https-tls-behind-apache-reverse-proxy/3097/3 "2015-06-23T19:40:40Z")

</div>

I see… so the secure solution might be:

- either not use of the apache’s Reverse Proxy Setup, but just syncthing’s https web gui (to the configured port)
- or use apache’s https setup (port 443) and inside there, use of an “equivalent” Reverse Proxy Setup to `https://localhost:port` right ?

for the second one, would it be something like this in the apache’s ssl.conf file ?

```
LoadModule ssl_module modules/mod_ssl.so
Listen 443
<VirtualHost _default_:443>
        DocumentRoot /var/www
        ErrorLog /pathtologs/syncthing-error_log
        TransferLog /pathtologs/syncthing-access_log
        SSLEngine on
        SSLProtocol all -SSLv2
        SSLCertificateFile /path-to/.config/syncthing/https-cert.pem
        SSLCertificateKeyFile /path-to/.config/syncthing/https-key.pem
        SSLProxyEngine On
        ProxyPass /syncthing/ https://127.0.0.1:8080/
        <Location /syncthing/>
                ProxyPassReverse https://127.0.0.1:8080/
                #Require all granted
                Allow from all
        </Location>
        ServerName servername
</VirtualHost>

```

in fact this is working, but I am asking for security reasons…

(forgive me if all these sound like “apache stuff”)

---

<div class="post-metadata">

### Author: ![calmh](https://forum.syncthing.net/user_avatar/forum.syncthing.net/calmh/32/15311_2.png) [@calmh](https://forum.syncthing.net/u/calmh)
#### Post date: [June 23, 2015, 7:45pm UTC](https://forum.syncthing.net/t/https-tls-behind-apache-reverse-proxy/3097/4 "2015-06-23T19:45:15Z")

</div>

I’m not an Apache master, but it looks like that would work (and do what it’s supposed to).

---

<div class="post-metadata">

### Author: ![wweich](https://forum.syncthing.net/user_avatar/forum.syncthing.net/wweich/32/1063_2.png) [@wweich](https://forum.syncthing.net/u/wweich)
#### Post date: [June 23, 2015, 7:58pm UTC](https://forum.syncthing.net/t/https-tls-behind-apache-reverse-proxy/3097/5 "2015-06-23T19:58:53Z")

</div>

You should also disable SSLv3, which is considered insecure.

Using the [Mozilla SSL Config Generator](https://mozilla.github.io/server-side-tls/ssl-config-generator/?hsts=no&profile=intermediate) is a good start for secure TLS.

---

<div class="post-metadata">

### Author: ![alexxtasi](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/a/f14d63/32.png) [@alexxtasi](https://forum.syncthing.net/u/alexxtasi)
#### Post date: [June 23, 2015, 8:43pm UTC](https://forum.syncthing.net/t/https-tls-behind-apache-reverse-proxy/3097/6 "2015-06-23T20:43:52Z")

</div>

thanks you all for the tips !

---

<div class="post-metadata">

### Author: ![DavidO](https://forum.syncthing.net/user_avatar/forum.syncthing.net/davido/32/1508_2.png) [@DavidO](https://forum.syncthing.net/u/DavidO)
#### Post date: [June 23, 2015, 10:59pm UTC](https://forum.syncthing.net/t/https-tls-behind-apache-reverse-proxy/3097/7 "2015-06-23T22:59:49Z")

</div>

If you’re interested in security, as well as ease of use and lightweightedness, give [Hiawatha](https://www.hiawatha-webserver.org/) a go.

More info:

- [Hiawatha - the best webserver you’ve never heard of](http://www.slideshare.net/Brunty/hiawatha-the-best-webserver-youve-never-heard-of)

- [Why I use Hiawatha Webserver](http://dotbalm.org/why-i-use-hiawatha-webserver/)
