Files
main/lb_configs/nginx.conf
Divarion-D 09faf1b1b2 init
2025-07-10 20:01:56 +03:00

127 lines
3.5 KiB
Nginx Configuration File

user xc_vm;
worker_processes auto;
worker_rlimit_nofile 300000;
events {
worker_connections 16000;
use epoll;
accept_mutex on;
multi_accept on;
}
thread_pool pool_xc_vm threads=32 max_queue=0;
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
reset_timedout_connection on;
gzip off;
fastcgi_read_timeout 200;
access_log off;
error_log /dev/null;
keepalive_timeout 10;
include balance.conf;
send_timeout 20m;
sendfile_max_chunk 512k;
lingering_close off;
aio threads=pool_xc_vm;
client_body_timeout 13s;
client_header_timeout 13s;
client_max_body_size 8m;
real_ip_header X-Forwarded-For;
include realip_cdn.conf;
include realip_cloudflare.conf;
include realip_xc_vm.conf;
include limit.conf;
limit_req_zone $binary_remote_addr zone=one:30m rate=20r/s;
server {
include ports/*.conf;
include ssl.conf;
include custom.conf;
index index.php index.html index.htm;
try_files $uri $uri.html $uri/ @extensionless-php;
root /home/xc_vm/www/;
server_tokens off;
chunked_transfer_encoding off;
resolver 1.1.1.1 1.0.0.1 valid=300s;
resolver_timeout 5s;
absolute_redirect off;
if ($request_method !~ ^(GET|POST)$) {
return 200;
}
rewrite_log on;
rewrite ^/key/(.*)$ /stream/key.php?token=$1 break;
rewrite ^/hls/(.*)$ /stream/segment.php?token=$1 break;
rewrite ^/tsauth/(.*)$ /stream/timeshift.php?token=$1 break;
rewrite ^/thauth/(.*)$ /stream/thumb.php?token=$1 break;
rewrite ^/auth/(.*)$ /stream/live.php?token=$1 break;
rewrite ^/vauth/(.*)$ /stream/vod.php?token=$1 break;
rewrite ^/subauth/(.*)$ /stream/subtitle.php?token=$1 break;
location = /streaming/rtmp.php {
return 302 /stream/rtmp.php?$args;
}
location ^~ /images/index.html {
return 404;
}
location ^~ /images/admin/index.html {
return 404;
}
location ^~ /images/enigma2/index.html {
return 404;
}
location ^~ /images/ {
# Stop executing
}
location ~ ^/status$ {
allow 127.0.0.1;
deny all;
fastcgi_index index.php;
fastcgi_pass php;
include fastcgi_params;
fastcgi_buffering on;
fastcgi_buffers 96 32k;
fastcgi_buffer_size 32k;
fastcgi_max_temp_file_size 0;
fastcgi_keep_conn on;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
}
location /nginx_status {
allow 127.0.0.1;
deny all;
stub_status on;
}
location ~ \.php$ {
limit_req zone=one burst=8;
include limit_queue.conf;
try_files $uri =404;
fastcgi_index index.php;
fastcgi_pass php;
include fastcgi_params;
fastcgi_buffering on;
fastcgi_buffers 96 32k;
fastcgi_buffer_size 32k;
fastcgi_max_temp_file_size 0;
fastcgi_keep_conn on;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
}
location @extensionless-php {
rewrite ^(.*)$ $1.php last;
}
}
}