http://www.52pi.net/archives/981
用树莓派做 RTMP 流直播服务器,可推送至斗鱼直播
http://shumeipai.nxez.com/2017/11/01/build-rtmp-stream-live-server-with-raspberry-pi.html
用树莓派DIY共享鱼缸,支持微信远程喂鱼
http://shumeipai.nxez.com/2017/09/27/nature-aquarium-for-sharing.html
阿里云服务器+树莓派+mjpeg-streamer实现外网视频监控
https://blog.csdn.net/little_bobo/article/details/78810137
实验平台
阿里云服务器 debain系统
树莓派3
一.树莓派安装mjpeg-streamer
见树莓派安装mjpeg-streamer
二.阿里云服务器安装配置Apache2
安装Apache2
apt-get install apache2
加载模块
a2enmod proxy proxy_ajp proxy_balancer proxy_connect proxy_ftp proxy_http
编辑proxy配置文件
nano /etc/apache2/mods-enabled/proxy.conf
我配置后的文件如下
我开启的是服务器的10005端口,阿里云服务器的外部访问端口要自己开启
重新启动apache2
service apache2 restart
三.树莓派通过ssh反向隧道将mjpeg-streamer的8080端口代理到公网VPS
ssh -fN -R 10005:localhost:8080 自己的阿里云服务器用户名@服务器IP
例如 ssh -fN -R 10005:localhost:8080 root@120.78.152.5
随后要输入服务器的登录密码
开启树莓派 mjpeg-streamer服务
开启方法见树莓派安装mjpeg-streamer
谷歌浏览器输入http://你的服务器ip/proxy/?action=stream
随后可以看到图像
————————————————
利用nginx实现反向代理
https://qiushangzhe.github.io/pi/2018/01/02/pi-nginx-proxy.html
nginx反向代理配置(多用于一个外网端口,多个内网服务端口)
首先我在本地用koa开启了两个http服务。 端口分别是3000和3001 返回的是当前访问的url和服务的端口号
然后nginx的配置文件
server {
listen 80;
location /service1/ {
proxy_pass http://127.0.0.1:3000/;
}
location /service2/ {
proxy_pass http://127.0.0.1:3001/;
}
}
最后重启nginx
nginx配置(一个外网端口,多个静态网站)
- 为了方便测试,我在本地创建了两个文件夹,作为两个网站的根目录。
开始配置nginx:
server {
listen 80;
location ^~ /service1/ {
alias /Users/qiusz/qiushangzhe/mycode/testcode/web01/;
index index.html;
}
location ^~ /service2/ {
alias /Users/qiusz/qiushangzhe/mycode/testcode/web02/;
index index.html;
}
}