When I've tried to use nginx on my zm server with such config
Code: Select all
server {
listen 80;
server_name blabla.com;
rewrite ^ https://blabla.com$request_uri? permanent;
}
server {
listen 443;
server_name blabla.com;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log info;
expires 31d;
ssl on;
ssl_certificate /etc/ssl/certs/server.crt;
ssl_certificate_key /etc/ssl/certs/server.key;
root /usr/share/zoneminder/www/;
index index.php;
location /cgi-bin {
gzip off;
root /usr/lib;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME /usr/lib/zoneminder/cgi-bin/nph-zms;
fastcgi_intercept_errors on;
fastcgi_pass unix:/var/run/fcgiwrap.socket;
}
location ~ \.php$ {
include fastcgi_params;
# NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
fastcgi_param SCRIPT_FILENAME $request_filename;
fastcgi_intercept_errors on;
fastcgi_pass unix:/var/run/php/php7.1-fpm.sock;
}
location ~* /.*\.(txt|log)$ {
deny all;
}
location ~* /.*\.(m4a|mp4|mov)$ {
mp4;
mp4_buffer_size 5M;
mp4_max_buffer_size 10M;
}
}
Code: Select all
2018/04/11 15:23:46 [error] 19124#19124: *11392 open() "/usr/share/zoneminder/www/zm/cgi-bin/nph-zms" failed (2: No such file or directory), client: 88.212.194.51, server: video-server.hosting.reg.ru, request: "GET /zm/cgi-bin/nph-zms?mode=jpeg&scale=100&maxfps=5&buffer=1000&monitor=1&connkey=330229&rand=306881 HTTP/1.1", host: "blabla.com", referrer: "https://blabla.com/index.php?view=watch&mid=1"
Code: Select all
<VirtualHost *:80>
ServerName blabla.com
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{SERVER_NAME}/$1 [R,L]
</VirtualHost>
<VirtualHost *:443>
ServerName blabla.com
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
SSLCertificateFile /etc/ssl/certs/server.crt
SSLCertificateKeyFile /etc/ssl/certs/server.key
</VirtualHost>