twitch-irl-docker/build/nginx/nginx.conf

140 lines
2.8 KiB
Nginx Configuration File

load_module "modules/ngx_rtmp_module.so";
user www-data;
worker_processes 1;
events {
worker_connections 1024;
}
http {
server_tokens off;
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 80;
access_log /nginx_access.log;
error_log /nginx_error.log info;
location /stat {
rtmp_stat all;
rtmp_stat_stylesheet stat.xsl;
allow all;
satisfy any;
}
location /stat.xsl {
root /var/www/html;
allow all;
satisfy any;
}
location / {
root /var/www/html;
try_files $uri $uri/index.py;
}
location /tts {
proxy_pass http://localhost:3000;
proxy_redirect off;
proxy_buffering off;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /var/www/html;
}
location ~* remote.js$ {
root /var/www/html;
allow all;
satisfy any;
}
location ~* debug.xml$ {
root /var/www/html;
allow all;
satisfy any;
}
location ~* \.php$ {
root /var/www/html/;
fastcgi_pass unix:/run/php/php7.4-fpm.sock;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
allow all;
satisfy any;
}
location ~* data.py$ {
gzip off;
root /var/www/html/;
fastcgi_pass unix:/var/run/fcgiwrap.socket;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
allow all;
satisfy any;
}
location ~* set_obs.py$ {
gzip off;
root /var/www/html/;
fastcgi_pass unix:/var/run/fcgiwrap.socket;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
allow all;
satisfy any;
}
location ~* set_ext.py$ {
gzip off;
root /var/www/html/;
fastcgi_pass unix:/var/run/fcgiwrap.socket;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
allow all;
satisfy any;
}
location ~* \.py$ {
gzip off;
root /var/www/html/;
fastcgi_pass unix:/var/run/fcgiwrap.socket;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
allow 127.0.0.1;
auth_basic "Login with your OBS remote password";
auth_basic_user_file /var/www/.htpasswd;
satisfy any;
}
}
}
rtmp {
server {
listen 1935;
chunk_size 4096;
application live {
live on;
record off;
allow publish all;
on_publish http://localhost/auth.php;
drop_idle_publisher 10s;
}
}
}