Making a unsecure webcam stream secure without PHP

Here comes a small tip serving an insecure non-HTTPS video stream as HTTP. If you run an Nginx web server, you can use its proxy feature to pass on the content. Since Nginx is one of the most efficient reverse proxy servers in existence, this setup will take minimal RAM from your webserver, unlike a PHP solution where you use passthru() for example.

location /my-stream {
    proxy_buffering off;
    proxy_pass http://<IP TO CAMERA>/video.mjpg;
}

And now you can embed the stream as an image on your HTTPS secured web page.

<img src="/my-stream">