是否可以使用运动创建安全连接?我已经使用 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/