avermedia

Nginx - конфиг для Zoneminder

Сегодня решил настроить таки Zoneminder - open source систему для создания видеонаблюдения на базе обычного компа, пока что успехи не значительны, настроил только nginx, решил выложить конфиг, может кому пригодится и сэкономит время.

  1. srv01:/etc/nginx/sites-enabled# cat zoneminder.host.com
  2.  
  3. server {
  4. listen 80;
  5. server_name zoneminder.host.com;
  6.  
  7. root /usr/share/zoneminder;
  8. location / {
  9. root /usr/share/zoneminder;
  10. index index.php;
  11. if (!-e $request_filename) {
  12. rewrite ^/(.*)$ /index.php?q=$1 last;
  13. }
  14. }
  15. location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico)$ {
  16. access_log off;
  17. expires 30d;
  18. }
  19. error_page 404 /index.php;
  20.  
  21. # redirect server error pages to the static page /50x.html
  22. #
  23. error_page 500 502 503 504 /50x.html;
  24. location = /50x.html {
  25. root /var/www/nginx-default;
  26. }
  27.  
  28. # proxy the PHP scripts to Apache listening on 127.0.0.1:80
  29. #
  30. #location ~ \.php$ {
  31. #proxy_pass http://127.0.0.1;
  32. #}
  33.  
  34. # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
  35. #
  36. location ~ \.php$ {
  37. fastcgi_pass 127.0.0.1:9000;
  38. fastcgi_index index.php;
  39. fastcgi_param SCRIPT_FILENAME /usr/share/zoneminder/$fastcgi_script_name;
  40. fastcgi_param QUERY_STRING $query_string;
  41. fastcgi_param REQUEST_METHOD $request_method;
  42. fastcgi_param CONTENT_TYPE $content_type;
  43. fastcgi_param CONTENT_LENGTH $content_length;
  44. include /etc/nginx/fastcgi_params;
  45. }
  46.  
  47. # deny access to .htaccess files, if Apache's document root
  48. # concurs with nginx's one
  49. #
  50. location ~ /\.ht {
  51. deny all;
  52. }
  53. }

Последние комментарии