Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Ubuntu Nginx Zoneminder php-fpm config

Zoneminder provides instructions for setting up Zoneminder on Ubuntu, but they assume you're using Apache: https://wiki.zoneminder.com/Ubuntu_Server_16.04_64-bit_with_Zoneminder_1.30.0_the_easy_way

I've moved away from Apache for webserving and wanted to see if there was a way to configure Zoneminder to work using Nginx and php-fpm. After a lot of trial and error I got it working. Include the snippet above in your nginx config to get it working at http:///zoneminder/ .

location ~ ^/zoneminder/(.+\.php)(.*)$ {
root /usr/share/zoneminder/www/;
fastcgi_split_path_info ([^/]+\.php)(.*)$;
fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
# Mitigate https://httpoxy.org/ vulnerabilities
fastcgi_param HTTP_PROXY "";
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
include /etc/nginx/fastcgi_params;
}
location /zoneminder/ {
alias /usr/share/zoneminder/www/;
index index.php;
}
location = /zoneminder/cgi-bin/nph-zms {
root /usr/lib/;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME /usr/lib/zoneminder/cgi-bin/nph-zms;
fastcgi_pass unix:/var/run/fcgiwrap.socket;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.