apache - 使用 SSL/HTTPS 保护 Raspberry Pi 运动视频流

标签 apache ssl raspberry-pi camera motion

是否可以使用运动创建安全连接?我已经使用 Apache 在 HTML 页面上嵌入了我的 Action 流,但它不会显示,因为它是使用letsencrypt和certbot加密的安全页面上的不安全img。我可以在以下位置查看运动流:http://www.example.com:<Motion-Port>但是嵌入的视频在https://example.com/camera.html不会显示。
图像代码:<img id="camera" src="http://xx.xxx.xxx.xx:8081">我试图修改 motion.conf 文件,但似乎没有做任何事情

webcontrol_tls on
stream_tls on
webcontrol_cert /etc/letsencrypt/live/www.example.com/fullchain.pem
webcontrol_key /etc/letsencrypt/live/www.example.com/privkey.pem
Picture of my setup
否则,我会很高兴了解另一种在我的网站上显示树莓派相机流的方法。

最佳答案

我找到了解决方案!
你不需要弄乱motion.conf。
您需要使用 ProxyPass 和 ProxyPassReverse 修改/etc/apache2/site-enabled

<IfModule mod_ssl.c>
<VirtualHost *:443>
        DocumentRoot "/var/www/html"
        ServerName www.example.com
        ServerAlias example.com


Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/www.example.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/www.example.com/privkey.pem

ProxyPass /camera http://xxx.xxx.x.xx:8081/
ProxyPassReverse /camera http://xxx.xxx.x.xx:8081/

</VirtualHost>
</IfModule>
然后在你的 .html 文件中
<img id="camera" src="https://www.example.com/camera">
你可以用任何你喜欢的方式修改相机

关于apache - 使用 SSL/HTTPS 保护 Raspberry Pi 运动视频流,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66780034/

相关文章:

python - 在 Raspberry Pi 上安装 Airflow 时找不到 BashOperator

apache - 尾部斜杠

php - 寻找比index.html更好的索引

asp.net - 在asp.net本地开发时如何模仿SSL?

java - 无法在 Raspberry Pi (Arch Linux) 上获取网络摄像头图像

python - 你如何在 OpenElec 中运行 python 脚本

apache - Windows 10 Creators Update (1703) 后 WampServer Apache httpd.exe 应用程序无法正确启动 (0xc0000142)

python - Ubuntu、Apache2、Django)致命的 Python 错误 : Py_Initialize: Unable to get the locale encoding ImportError: No module named 'encodings'

Javascript AES 加密与 SSL

node.js - 如何使用 Node 配置ssl