NGINX Configuration for Multi Server Setup
Posted: Tue Dec 07, 2021 12:28 pm
I've been using Ngnix as a reverse proxy for some time now and managed to get a working solution for my setup. It's lacking in a few areas, but certainly work about. What I would like to get working is the FPS output that's below the camera. I've attached two images below to show and my Nginx conf. The top one shows what I get when access via my Nginx server and the bottom one is when accessing a Zoneminder server directly.
Does anyone have any suggestions?
Does anyone have any suggestions?
Code: Select all
server {
access_log /var/log/nginx/zoneminder.access.log;
error_log /var/log/nginx/zoneminder.error.log;
listen 80;
server_name FQDN HERE;
location / {
add_header Last-Modified $date_gmt;
add_header Cache-Control 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0';
if_modified_since off;
expires 60;
etag off;
proxy_pass http://HOSTNAME HERE;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Port $server_port;
}
location /zm/cgi-bin {
auth_basic off;
alias /usr/libexec/zoneminder/cgi-bin;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $request_filename;
fastcgi_param HTTP_PROXY "";
fastcgi_pass unix:/var/run/fcgiwrap.socket;
}
location ~ /zm/api/(css|img|ico) {
auth_basic off;
rewrite ^/zm/api(.+)$ /api/app/webroot/$1 break;
try_files $uri $uri/ =404;
}
}