church_vod/conf/nginx.conf
2024-02-07 19:50:20 +00:00

206 lines
5.3 KiB
Nginx Configuration File

worker_processes auto;
events {
worker_connections 1024;
# multi_accept on;
}
http {
##
# Basic Settings
##
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
# server_tokens off;
# server_names_hash_bucket_size 64;
# server_name_in_redirect off;
include mime.types;
default_type application/octet-stream;
##
# SSL Settings
##
# ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
# ssl_prefer_server_ciphers on;
##
# Logging Settings
##
# access_log /var/log/nginx/access.log;
# error_log /var/log/nginx/error.log;
log_format main '$remote_addr $remote_user [$time_local] "$request" '
'$status "$http_referer" "$http_user_agent"';
access_log /dev/stdout main;
error_log stderr debug;
##
# Gzip Settings
##
gzip on;
gzip_disable "msie6";
# gzip_vary on;
# gzip_proxied any;
# gzip_comp_level 6;
# gzip_buffers 16 8k;
# gzip_http_version 1.1;
# gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
##
# Virtual Host Configs
##
server {
listen 80 default_server;
listen [::]:80 default_server;
root /srv/nginx/www;
index index.html index.htm index.nginx-debian.html;
server_name filadelfia.nfp.is;
add_header Access-Control-Allow-Headers "*";
add_header Access-Control-Expose-Headers "*";
add_header Access-Control-Allow-Methods "GET, HEAD, OPTIONS";
add_header Access-Control-Allow-Origin "*";
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ /index.html;
#try_files $uri /notfound.mp4;
#if (!-e $request_filename) {
# rewrite . /notfound.mp4 break;
#}
}
location /kennsluraudio {
root /srv/filo_web;
}
location /posters {
root /srv/filo_web;
}
location /kennslurraw {
alias /srv/filo_web/kennslur;
autoindex on;
}
#VOD MODULE TEST
open_file_cache max=1000 inactive=5m;
open_file_cache_valid 2m;
open_file_cache_min_uses 1;
open_file_cache_errors on;
location /vod-status/ {
vod_status;
}
location /kennslur/ {
vod hls;
vod_mode local;
vod_metadata_cache metadata_cache 15g 6h;
vod_response_cache response_cache 1g 6h;
vod_performance_counters perf_counters;
vod_align_segments_to_key_frames on;
vod_manifest_segment_durations_mode accurate;
vod_hls_absolute_master_urls off;
vod_hls_absolute_index_urls off;
vod_hls_absolute_iframe_urls off;
root /srv/filo_web;
gzip on;
gzip_types application/vnd.apple.mpegurl;
expires 100d;
add_header Last-Modified "Sun, 19 Nov 2000 08:52:00 GMT";
add_header Access-Control-Allow-Headers "*";
add_header Access-Control-Expose-Headers "*";
add_header Access-Control-Allow-Methods "GET, HEAD, OPTIONS";
add_header Access-Control-Allow-Origin "*";
}
#VOD TEST ENDS
error_page 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 420 422 423 424 426 428 429 431 444 449 450 451 500 501 502 503 504 505 506 507 508 509 510 511 /index.html;
location /index.html {
alias /srv/nginx/www/index.html;
}
location /crossdomain.xml {
alias /srv/nginx/www/crossdomain.xml;
}
location /start_the_recording.php {
content_by_lua_file /srv/nginx/www/start_the_recording.lua;
}
location /stop_recording.php {
content_by_lua_file /srv/nginx/www/stop_recording.lua;
}
location /samkomur.html {
content_by_lua_file /srv/nginx/www/samkomur.lua;
}
location /samkomur.json {
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
#
# Custom headers and headers various browsers *should* be OK with but aren't
#
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range';
#
# Tell client that this pre-flight info is valid for 20 days
#
add_header 'Access-Control-Max-Age' 1728000;
add_header 'Content-Type' 'text/plain; charset=utf-8';
add_header 'Content-Length' 0;
return 204;
}
if ($request_method = 'GET') {
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range';
add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range';
}
content_by_lua_file /srv/nginx/www/samkomur_json.lua;
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
#location ~ \.php$ {
# include snippets/fastcgi-php.conf;
#
# # With php5-cgi alone:
# fastcgi_pass 127.0.0.1:9000;
# # With php5-fpm:
# fastcgi_pass unix:/var/run/php5-fpm.sock;
#}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
location ~ /\.ht {
deny all;
}
}
}