#StackBounty: #nginx #reverse-proxy Reverse Proxy for IP Camera

Bounty: 150

I’m using an Amcrest camera which requires basic auth to render its stream (documentation – page 17). The camera is accessed through http://admin:password@IP_CAMERA/cgi-bin/mjpg/video.cgi .

When I try to hit :56700, I am prompted for auth even though it’s hardcoded (below). Even when I enter the correct credentials, it fails. What am I doing wrong?

    server {
        listen 56700;
        location / {
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_pass http://IP_CAMERA/cgi-bin/mjpg/video.cgi;
            proxy_set_header Authorization "Basic xxx";
        }
    }

I’ve also tried adding proxy_pass_header Authorization; as described here.


Get this bounty!!!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.