below i have added the line of code for you. Restart xtreamcodes nginx after adding the file.
code to stop and start xtreamcodes nginx:
/home/xtreamcodes/iptv_xtream_codes/nginx/sbin/nginx
/home/xtreamcodes/iptv_xtream_codes/nginx/sbin/nginx -s stop
user xtreamcodes;
worker_processes auto;
worker_rlimit_nofile 300000;
events {
multi_accept on;
worker_connections 16000;
use epoll;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
proxy_buffering off;
client_max_body_size 100m;
gzip on;
gzip_comp_level 5;
fastcgi_read_timeout 180;
server {
listen 3389;
index index.php index.html index.htm;
root /home/xtreamcodes/iptv_xtream_codes/wwwdir/;
server_tokens off;
chunked_transfer_encoding off;
rewrite_log on;
rewrite ^/live/(.*)/(.*)/(.*)\.(.*)$ /streaming/clients_live.php?username=$1&password=$2&stream=$3&extension=$4 break;
rewrite ^/movie/(.*)/(.*)/(.*)$ /streaming/clients_movie.php?username=$1&password=$2&stream=$3 break;
rewrite ^/(.*)/(.*)/(.*).ch$ /streaming/clients_live.php?username=$1&password=$2&stream=$3&extension=ts break;
rewrite ^/(.*)\.ch$ /streaming/clients_live.php?extension=ts&stream=$1&qs=$query_string break;
rewrite ^/ch(.*)\.m3u8$ /streaming/clients_live.php?extension=m3u8&stream=$1&qs=$query_string break;
location ~ \.php$ {
try_files $uri =404;
if ($uri ~* /streaming) {
gzip off;
}
if ($uri ~* /get.php) {
gzip off;
}
# CORS setup
add_header 'Access-Control-Allow-Origin' '*' always;
add_header 'Access-Control-Expose-Headers' 'Content-Length';
# allow CORS preflight requests
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Max-Age' 1728000;
add_header 'Content-Type' 'text/plain charset=UTF-8';
add_header 'Content-Length' 0;
return 204;
}
#access_log /home/xtreamcodes/iptv_xtream_codes/tmp/access.log;
fastcgi_index index.php;
fastcgi_pass unix:/home/xtreamcodes/iptv_xtream_codes/php/php.sock;
include fastcgi_params;
fastcgi_keep_conn on;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
}
}
}
rtmp_auto_push on;
rtmp {
server {
listen 8001;
interleave on;
wait_video on;
idle_streams off;
max_streams 512;
application input{
live on;
allow play 127.0.0.1; # localhost
deny play all;
}
}
}