Working Unifi UNVR NGINX Config
-
As the title says, I am trying to setup UNVR behind NGINX and wonder if anyone has a working config. I can get the webUI to show up but livestream or video playback is not working. My google-fu is failing me in trying to find which ports need to be part of my config.
-
@nashbrydges said in Working Unifi UNVR NGINX Config:
As the title says, I am trying to setup UNVR behind NGINX and wonder if anyone has a working config. I can get the webUI to show up but livestream or video playback is not working. My google-fu is failing me in trying to find which ports need to be part of my config.
I'm just assuming you've already seen Ubiquiti's documentation? https://help.ui.com/hc/en-us/articles/217875218-UniFi-Video-Ports-Used
-
@travisdh1 I did, yes, however this was at the top of the page which prompted me to come here...
-
@nashbrydges If they're done with it ... wish they'd release their NVR as open source and let others use and update it.
-
RTSP... I believe you need Nginx Plus you're wanting to do something other than HTTP
-
@flaxking said in Working Unifi UNVR NGINX Config:
RTSP... I believe you need Nginx Plus you're wanting to do something other than HTTP
Assuming RTSP isn't required, I'm guessing you need to enable the video connection for webrtc, which I think is just a one liner in nginx
-
@flaxking said in Working Unifi UNVR NGINX Config:
@flaxking said in Working Unifi UNVR NGINX Config:
RTSP... I believe you need Nginx Plus you're wanting to do something other than HTTP
Assuming RTSP isn't required, I'm guessing you need to enable the video connection for webrtc, which I think is just a one liner in nginx
This maybe?
proxy_set_header Connection "Upgrade";
-
@nashbrydges I setup two configurations, one for Port 7443 through HTTPS and another with port 7446 which is for video playing.
-
@dbeato The configuration I have is below:
Web UI
server { client_max_body_size 40M; server_name dvr2.domain.com; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_set_header X-NginX-Proxy true; location / { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_set_header X-NginX-Proxy true; proxy_pass https://dvr.domain.com:7443/; proxy_redirect https://dvr.domain.com:7443/ /; proxy_read_timeout 60s; # Socket.IO Support proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; }
Video Playing
server { client_max_body_size 40M; server_name dvr2.domain.com; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_set_header X-NginX-Proxy true; location / { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_set_header X-NginX-Proxy true; proxy_pass https://dvr.domain.com:7446/; proxy_redirect https://dvr.domain.com:7446/ /; proxy_read_timeout 60s; # Socket.IO Support proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; add_header Access-Control-Allow-Origin *; add_header Access-Control-Max-Age 3600; add_header Access-Control-Expose-Headers Content-Length; add_header Access-Control-Allow-Headers Range; }
-
@dbeato Thanks. I'll give this a try over the weekend.