etc-configs/nginx/nginx.conf

110 lines
2.4 KiB
Nginx Configuration File
Raw Normal View History

2022-12-03 01:01:28 -03:00
user www-data;
worker_processes auto;
worker_rlimit_nofile 65535;
2022-12-03 01:01:28 -03:00
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;
2023-12-21 14:01:35 -03:00
load_module /usr/lib/nginx/modules/ngx_rtmp_module.so;
include /etc/nginx/conf.d/*.conf;
2022-12-03 01:01:28 -03:00
events {
worker_connections 65535;
multi_accept on;
2022-12-03 01:01:28 -03:00
}
2023-12-21 14:01:35 -03:00
rtmp_auto_push on;
rtmp_auto_push_reconnect 10s;
rtmp {
max_connections 1000;
server {
listen 1935;
allow publish 0.0.0.0;
deny play all;
chunk_size 4096;
application live {
sync 100ms;
# play_restart on;
interleave on;
# wait_key on;
# wait_video on;
drop_idle_publisher 10s;
#dash
dash on;
dash_path /tmp/dash;
dash_fragment 1;
dash_playlist_length 10;
#hls
hls on;
hls_fragment_naming system;
hls_path /tmp/hls;
hls_fragment 1;
hls_playlist_length 10;
hls_continuous on;
#rtmp
#on_publish http://127.0.0.1:7069/forms/stream;
live on;
record off;
}
}
}
2022-12-03 01:01:28 -03:00
http {
2023-12-21 14:01:35 -03:00
log_format limited '$remote_addr - $remote_user [$time_local] '
'"$request_method /bogus $server_protocol" $status $body_bytes_sent '
'"-" "Bogus/66.6"';
access_log off;
error_log /dev/null;
2022-12-03 01:01:28 -03:00
# Basic Settings
charset utf-8;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
server_tokens off;
log_not_found off;
2023-12-21 14:01:35 -03:00
types_hash_max_size 1024;
types_hash_bucket_size 64;
2023-12-21 14:01:35 -03:00
server_names_hash_bucket_size 128;
# MIME
include mime.types;
default_type application/octet-stream;
# SSL
2023-12-21 14:01:35 -03:00
include configs/sslConfig.conf;
# DDOS Protection
limit_conn_zone $binary_remote_addr zone=perip:10m;
2022-12-03 01:01:28 -03:00
limit_conn perip 100;
# reset timed out connections freeing ram
reset_timedout_connection on;
# maximum time between packets the client can pause when sending nginx any data
client_body_timeout 10s;
# maximum time the client has to send the entire header to nginx
client_header_timeout 10s;
# timeout which a single keep-alive client connection will stay open
2023-12-21 14:01:35 -03:00
keepalive_timeout 60s;
2022-12-03 01:01:28 -03:00
# maximum time between packets nginx is allowed to pause when sending the client data
send_timeout 10s;
2023-12-21 14:01:35 -03:00
# QUIC AND HTTP3 SHIT
http3 on;
quic_retry on;
quic_gso on;
2023-12-21 14:01:35 -03:00
# PERFORMANCE / ASYNC I/O
aio threads=default;
aio_write on;
directio 2m;
# Maps
include /etc/nginx/snippets/maps.conf;
# Virtual Host Configs
include /etc/nginx/sites-enabled/*.conf;
2022-12-03 01:01:28 -03:00
}