The configuration file is in /usr/local/nginx-micropvr/conf/nginx.conf.
Example configuration:
worker_processes 16;
error_log logs/error.log debug;
events {
worker_connections 1024;
use epoll;
multi_accept on;
}
http
access_log logs/access.log;
error_log logs/error.log;
include mime.types;
default_type application/octet-stream;
sendfile off;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 5;
send_timeout 36000;
server {
listen 8080;
location /pvr/playlist {
pvr_api_host "127.0.0.1";
pvr_api_port 4089;
pvr_playlist;
}
location /pvr/ {
pvr_location /var/pvr_links/;
}
location / {
pvr_api_host "127.0.0.1";
pvr_api_port 4089;
ts_statistics "/usr/local/nginx-micropvr/logs/ts_stat.log";
ts_statistics_near_end_time 300
ts;
}
location = /nginx-stats {
stub_status on;
access_log off;
allow 127.0.0.1;
deny all;
}
}
}
Connection settings for micropvr
Address API MicroPVR
Option name: pv_api_host, data type: string.
IP address of JSON-RPC API of micropvr process. The API is used by the nginx module to obtain information about the file and offset.
MicroPVR API Portal
Option name: pv_api_port, data type: int.
The JSON-RPC API port of the micropvr process.
Streaming settings
Listening port
Option name: listen, data type: int.
The port on which the web server will wait for the connection. By default 8080.
Broadcasting in HTTP-TS format
Option name: ts.
HLS broadcasting
Option name: pvr_playlist.
Redirects the client to the playlist corresponding to the request.
Path to symbolic references
Option name: pvr_location, data type: string.
The path to the directory specified in micropvr.conf records-link.
Logging settings for PVR sessions
The session log can be used for monitoring, written in the format:
1501505267 X.X.X.X:37646 /ts 1 0
where:
- 1501505267 - timestamp.
- X.X. X. X:37646 The client’s IP address and socket port.
- /ts - URL.
- 1 - Channel ID (channel_id).
- 1 - Account ID (aid).
- 0 If 1 is a Pause Live TV session, or 0.
If a parameter is not transferred to the PVR URL aid, then the session is not logged.
The path to the session log
Option name: ts_statistics, data type: string.
Absolute path to the log file. With an empty value or missing parameter, logging is disabled.
Time for Pause Live TV
Option name ts_statistics_near_end_time, int data type.
The maximum difference between the current time and the beginning of the recording, in which the session is considered a session of watching TV in pause (Pause Live TV).
Other settings
Other settings are standard for the web server nginx.