ZP_EchoNestPy icon indicating copy to clipboard operation
ZP_EchoNestPy copied to clipboard

apache proxy

Open sgrayban opened this issue 10 years ago • 3 comments

Have you tried to use apache proxy to forward the requests install of stunnel or ngix ?

sgrayban avatar Aug 18 '15 19:08 sgrayban

No I havent. I used to use apache proxy a lot but since then I have been using nginx and have just stuck with it.

Why do you ask?

zpriddy avatar Aug 21 '15 15:08 zpriddy

Here's basic Apache config for proxying to the internal Flask server.

Some notes: I've changed Flask to use HTTP instead of HTTPS. This would probably still work with HTTPS, just change the protocols on the ProxyPass lines.

<VirtualHost *:443>
  ServerName nest.myServer.com

  SSLEngine on
  SSLProxyEngine on

  SSLCertificateFile      /etc/letsencrypt/live/nest.myServer.com/cert.pem
  SSLCertificateKeyFile   /etc/letsencrypt/live/nest.myServer.com/privkey.pem
  SSLCertificateChainFile /etc/letsencrypt/live/nest.myServer.com/chain.pem

  ProxyRequests Off
  <Proxy *>
    Order deny,allow
    Allow from all
  </Proxy>

  ProxyPass / http://127.0.0.1:5000/
  ProxyPassReverse / http://127.0.0.1:5000/

  <Location />
    Order allow,deny
    Allow from all
  </Location>

  ErrorLog ${APACHE_LOG_DIR}/error_nest.log
  CustomLog ${APACHE_LOG_DIR}/access_nest.log combined
</VirtualHost>

For SSL certs I used letsEncrypt. It's free and it will soon be more wildly supported. Directions here: https://letsencrypt.org/getting-started/

Because you're proxying you probably cant generate the certs using the automated way, so turn your Apache server off and run: ./letsencrypt-auto certonly --standalone -d example.com

Should plop certs in /etc/letsencrypt/live/example.com. Modify the paths in the above accordingly.

Respond if you need more answers, this is a pretty old question and Amazon is adding Nest support shorty I hear.

Skinner927 avatar Mar 17 '16 03:03 Skinner927

Yeah - I hear it should be in the next few weeks - I have turned my focus onto my own home automation system for the mean time.

If Echo doesnt support Nest in the next few weeks ill revamp this project. Otherwise I dont see much reason to..

zpriddy avatar Mar 17 '16 23:03 zpriddy