server {
listen ip.ip.ip.ip;
root /var/www/domen;
index index.php index.html index.htm;
server_name domen.tv
www.domen.tv;
client_max_body_size 2g;
location / {
try_files $uri /index.php;
}
location ~ \.php$ {
access_log /var/log/nginx/access_tv.log;
error_log /var/log/nginx/error_tv.log;
include fastcgi_params;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
}
location ~ \.mp4$ {
root /var/www/videofiles/;
rewrite ^/video/(.+)$ /$1 last;
access_log /var/log/nginx/access_tv_mp4.log;
error_log /var/log/nginx/error_tv_mp4.log;
mp4;
mp4_buffer_size 5m;
mp4_max_buffer_size 10m;
}
location ~ \.flv$ {
root /var/www/videofiles/;
rewrite ^/video/(.+)$ /$1 last;
access_log /var/log/nginx/access_tv_flv.log;
error_log /var/log/nginx/error_tv_flv.log;
flv;
}
}