Re: How to run a reverse proxy VM on your BI...
Posted: Tue Jan 21, 2020 4:58 pm
Blue Iris User Group
https://blueiris.pro/forum/
And where does all this go. Do I access a config file or type it into the terminal?HeneryH wrote: ↑Tue Jan 21, 2020 4:46 pm Nginx works by matching patterns in the URL to figure out the desired destination. If you don't have multiple web servers or domain names then you can just put the configs below in the default config.
FYI on Nginx Install Warns - You may see these warnings and can edit the main config file.I have multiple domain names I like to route separatelyCode: Select all
[warn] 21183#0: could not build optimal types_hash, you should increase either types_hash_max_size: 2048 or types_hash_bucket_size: 64; ignoring types_hash_bucket_size cd /etc/nginx vi nginx.conf # add an include for the sites-enabled directory (if you are using them), fix the warns # server_names_hash_bucket_size 64;
Put this relevant line in either you default or specific config.Code: Select all
mkdir /etc/nginxsites-enabled vi /etc/nginxsites-enabled/domain1.com.conf vi /etc/nginxsites-enabled/domain2.com.conf ## you most likely don't need this #htpasswd -c /etc/nginx/.htpasswd jjflynn22 # the -c only for first time # this is for passwords in Nginx nginx -s reload # after changes force a reload of configs
Code: Select all
location / { proxy_pass http://192.168.1.10:81; # <--- where this is your BI instance }
Code: Select all
# For more information on configuration, see:
# * Official English Documentation: http://nginx.org/en/docs/
# * Official Russian Documentation: http://nginx.org/ru/docs/
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;
# Load dynamic modules. See /usr/share/doc/nginx/README.dynamic.
include /usr/share/nginx/modules/*.conf;
events {
worker_connections 1024;
}
http {
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 4048; ###### <----- this corrects the warning
include /etc/nginx/mime.types;
default_type application/octet-stream;
# Load modular configuration files from the /etc/nginx/conf.d directory.
# See http://nginx.org/en/docs/ngx_core_module.html#include
# for more information.
include /etc/nginx/conf.d/*.conf;
server { ###### <----- this is the default server if there are no other blocks that match
listen 80 default_server;
listen [::]:80 default_server;
server_name _;
root /usr/share/nginx/html;
# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;
location / { ###### <----- You can put the proxy command here if you would like and don't have any other web configs
}
error_page 404 /404.html;
location = /40x.html {
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
}
include /etc/nginx/sites-enabled/*.conf; ###### <----- Many people serve multiple virtual web servers
}
Anyone can hit this server by just IP address. No problem using the default nginx server block.
I posted a short bash script here that I use (on my Linux Mint box) for uploading the current WAN IP whenever my PC reboots. It puts the IP in a text file and uploads it to one of my servers, so if I'm somewhere else and it changes (like from a power outage) all I need to do is go to the site and view the text file.
Yes, either static or DDNS. I use a service on my main PC box to update my DDSN service. There are many options and it can be updated by any machine on your home network. I actually ended up paying a small fee for some extra benefits I found useful.
HeneryH, am I correct in assuming the solution you've outlined in this thread will allow me to host a WordPress website on a VM on a Windows Server also running Blue Iris...and make it look like the Blue Iris camera feeds are in a subdirectory of the WordPress website?HeneryH wrote: ↑Sat Jan 18, 2020 9:06 pm
- The reverse proxy can accept incoming connections and route those connections to BI or whatever other servers you may have running. I have a BI instance running in my home but also several other servers. The single reverse proxy knows what the incoming connection looks like and routes appropriately.