Anyone using https with ProxyPass and Alexa?

Is anyone using Amazon Echo/Alexa and has a https setup with ProxyPass? I can not get Alexa running with my setup. Before i had direct https send to hass but i wanted https on rest off my server too so i did it with proxyPass. hass is working fine with that, but Alexa is not longer working. On under test i get only a default error message.

I am not sure what infos you need from me so please ask and i will answer. :wink:

Here is my vhost config from apache2

<IfModule mod_ssl.c>
        <VirtualHost *:443>
                ServerAdmin [email protected]

                CustomLog ${APACHE_LOG_DIR}/proxy_hass_access.log combined
                ErrorLog ${APACHE_LOG_DIR}/proxy_hass_error.log
                LogLevel warn

                ProxyRequests off

                SSLEngine on
                SSLProxyEngine On
                SSLCertificateFile      /etc/letsencrypt/live/
                SSLCertificateKeyFile   /etc/letsencrypt/live/
                SSLCertificateChainFile /etc/letsencrypt/live/

                SSLCACertificatePath    /etc/ssl/certs/

                ProxyRequests off
                ProxyPreserveHost on

                <Location />

                        Order Deny,Allow
                        Allow from all

                        #AuthType Basic
                        #AuthName "You shall not pass"
                        #AuthBasicProvider file
                        #AuthUserFile /etc/apache2/.htpasswd
                        #Require valid-user

                        ProxyPass retry=0
                        ProxyPass ws:// retry=0
                        ProxyPassReverse ws://


And here the hass error i get when trying to get an Alexa answer.

17-02-28 13:53:27 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.5/site-packages/aiohttp/", line 62, in handle_request
    resp = yield from self._handler(request)
  File "/usr/local/lib/python3.5/site-packages/aiohttp/", line 270, in _handle
    resp = yield from handler(request)
  File "/usr/src/app/homeassistant/components/http/", line 57, in ban_middleware_handler
    return (yield from handler(request))
  File "/usr/local/lib/python3.5/asyncio/", line 213, in coro
    res = yield from res
  File "/usr/src/app/homeassistant/components/http/", line 417, in handle
    result = yield from result
  File "/usr/src/app/homeassistant/components/", line 136, in post
    data = yield from request.json()
  File "/usr/local/lib/python3.5/site-packages/aiohttp/", line 405, in json
    return loads(body)
  File "/usr/local/lib/python3.5/json/", line 319, in loads
    return _default_decoder.decode(s)
  File "/usr/local/lib/python3.5/json/", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/lib/python3.5/json/", line 357, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Sorry I canโ€™t really help there as I am using nginx and not apache as WebServer. But maybe it would be okay for you to use a subdomain like โ€œwww.hass.time4.tvโ€ so you would not need a proxy_pass. Don#t know if thatโ€™s an option with your DNS provider tho.

~Cheers is a subdomain of

If anyone having similar problem, i got it working after updating the proxy pass setting with setting from here

And now i have https for extern, http for local and Alexa is also working over https :slight_smile:

1 Like

Sorry for not getting back to you! I have no idea about apache as I use nginx. But thanks for reporting back on the solution!


Iโ€™m trying to link the Alexa Android App to HA through my NGINX Proxy Manager.
Using the European Client_ID fails with the error message Invalid redirect URI, but if I use the US Client_ID it will connect and link successfully with HA. But it fails to discover any new devices.
I suspect I need some additional Proxy setting to make this work, but I do not know which one.