NGINX Configuration for Multi Server Setup

Discussions related to the 1.36.x series of ZoneMinder
Post Reply
Maximo1970
Posts: 76
Joined: Sun May 28, 2017 4:29 pm

NGINX Configuration for Multi Server Setup

Post by Maximo1970 »

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?
No FPS.PNG
No FPS.PNG (18.4 KiB) Viewed 5834 times
With FPS.PNG
With FPS.PNG (17.6 KiB) Viewed 5834 times

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;
        }

}

Post Reply