Error 404 json with nginx

killer2239

n3wb
Joined
Jan 17, 2019
Messages
2
Reaction score
3
Location
USA
I have the web interface working fine for years now with no issue. I wanted to add the web interface to work with my nginx server. I changed the virtual directory to /bi , to match the domain.com/bi url. I have tried multiple different proxy pass configurations I could find from various people with different settings that all have it working with no issue. I have LAN interface to not require authentication. If I go to the new bi path of domain.com:port/bi using the blueiris port I have forwarding to the BI web it still works too. However, I get the web interface to start loading on domain.com/bi , but the 3 line down fails where it says

Checking Session Status... Fail

Then in the bottom right the red box says:
Error contacting blue iris server to check session status.
Status: error
Error: URL: /json

When I view the connections in blue iris, it shows the Anonymous connection with my nginx servers local IP trying to connect. I have tried this in both Chrome and Edge to make sure it wasn't just Chrome. So something is not passing or working with the session checking.

I enabled login auth for all connections because it seems session related, and I got an error when it tries to load the login page. Its doing com/bilogin.htm?page=%2F , it is leaving out the / between bi and login. I am running the latest BlueIris from 12/31, so I think it might be an issue with the syntax somewhere with the logins / sessions for it. Any ideas on a file to mod, or is this a bug the dev needs to fix?
 

killer2239

n3wb
Joined
Jan 17, 2019
Messages
2
Reaction score
3
Location
USA
So after lots of trial and error. I finally figured out the correct settings for nginx forwarding to the non-root level.

For anyone else having these issues here is out how I fixed it.

I finally figured it out after trial and error using some nginx redirect stuff that "monit" has to use to work. So here is how I got it working with nginx, not sure if it will help the OP but hopefully it helps anyone else in the future not wanting the root / to be their BlueIris setup.

In the settings of BlueIris under webserver:
virtual is: /bi/ (You can change bi to whatever you want)

Then for nginx reverse config assuming your port is 81 and BlueIrisServerIP is 192.168.1.220

Code:
location /bi/ {
	rewrite ^/bi/(.*) /$1  break;
	proxy_ignore_client_abort on;
	proxy_pass http://192.168.1.220:81;
	proxy_redirect http://192.168.1.220:81 /bi;
}
 
Top