Highlighted
New Member
Posts: 37
Registered: ‎07-21-2015
Kudos: 3

NGINX Reverse Proxy in a Docker Container

So I have been scouring the forums trying to find a way to get Unifi Video to work behind an NGINX Reverse Proxy, both applications are in docker containers on Unraid.

https://github.com/linuxserver/docker-letsencrypt

https://github.com/pducharme/UniFi-Video-Controller

 

I can get it to work except I get the dread 'Unable to load live stream' on all my cameras when accessing from outside my network. This is my config file for letsencrypt NGINX reverse proxy

 

server {
        listen 80;
        listen 443 ssl http2;
	 	listen 7443 ssl http2;
        listen [::]:443 ssl http2;

        server_name  video.*;                   
   
location / {
                # Proxy
                      # Reverse Proxy
                proxy_redirect          off;
                proxy_pass_header       Server;
                proxy_set_header        X-Real-IP $remote_addr;
                proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header        X-Scheme $scheme;
                proxy_set_header        Host hazzardcounty.co.nz;
				proxy_set_header        X-NginX-Proxy true;
                proxy_connect_timeout   5;
                proxy_read_timeout      240;
                proxy_intercept_errors  on;

                proxy_pass             http://192.168.1.100:7080/; 

## WebSockets
        location / {
    proxy_pass http://192.168.1.100:7080/;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
}


        # Redirect to HTTPS
                  if ($scheme = http) {
                       return 301 https://$server_name$request_uri; #CHANGE THIS (uncomment) after cert installation
                  }
        }
}

server {
        listen 7446 ssl;

        server_name  video.*;                   
 
location / {
                # Proxy
                      # Reverse Proxy
                proxy_redirect          off;
                proxy_pass_header       Server;
                proxy_set_header        X-Real-IP $remote_addr;
                proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header        X-Scheme $scheme;
                proxy_set_header        Host hazzardcounty.co.nz;
				proxy_set_header        X-NginX-Proxy true;
                proxy_connect_timeout   5;
                proxy_read_timeout      240;
                proxy_intercept_errors  on;

                proxy_pass             http://192.168.1.100:7445/; 

## WebSockets
        location / {
    proxy_pass http://192.168.1.100:7445/;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
}
}
}

I'm obviously not passing the camera streams out into the world. I'm just wondering if anyone else has been able to successfully get there set up like this up and running.

 

Cheers,

Laurie