I want to be able to forward my IP Camera's feed to a website. I want to make my website public via my nginx server (on Ubuntu 20.04).
First of all, I use VLC to re-stream my IP cameras feed:
vlc --intf dummy -vvv "rtsp://<user>:<password>@10.0.0.34:554/stream2" --sout "#transcode{vcodec=theo,vb=720,scale=Auto,acodec=none,ab=128,channels=2,samplerate=44100,scodec=none}:http{mux=ogg,dst=:8081/}" --sout-all --sout-keep --nooverlay --daemon
That means that I locally, on my LAN, can do something like this
<html>
<head>/head>
<body>
<video>
<source src="http://10.0.0.63:8080" type="video/mp4">
</video>
</body>
</html>
Allright, it works locally, but how can I configure my nginx server to pass the feed?
This is what I want to achieve: https://my.domain.com/camera2 --nginx-server--> http://10.0.0.63:8080
<html>
<head>/head>
<body>
<video>
<source src="https://my.domain.com/camera2" type="video/mp4">
</video>
</body>
</html>
This is what I have tried with no success:
http {
proxy_cache_path /var/www/my.domain.com/cache levels=1:2 keys_zone=STATIC:10m inactive=24h max_size=1g;
server {
listen 80;
server_name my.domain.com;
location /camera2 {
proxy_pass http://10.0.0.63:8080;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}
}
nginx.conf
What is the correct nginx configuration to proxy_pass to a local VLC video stream?