I have heard some people saying about XtreamUI does not happens, and trying to fix it by my own i have found some settings to fix it, not too perfect but works pretty well after.
first we need to go here /home/xui/bin/nginx/conf/ im using mobxterm so i edit wit his own editor, important, always doa backup from original file nginx.conf
i have replace text http till server and it leave like that
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
reset_timedout_connection on;
include gzip.conf;
fastcgi_read_timeout 200;
access_log off;
error_log /dev/null;
keepalive_timeout 120;
include balance.conf;
send_timeout 20m;
proxy_read_timeout 300s;
proxy_connect_timeout 300s;
proxy_send_timeout 300s;
sendfile_max_chunk 1m;
lingering_close off;
aio threads=pool_xui;
client_body_timeout 13s;
client_header_timeout 13s;
client_max_body_size 8m;
proxy_buffer_size 16k;
proxy_busy_buffers_size 24k;
proxy_buffers 64 4k;
proxy_max_temp_file_size 0;
real_ip_header X-Forwarded-For;
include realip_cdn.conf;
include realip_cloudflare.conf;
include realip_xui.conf;
include limit.conf;
limit_req_zone $binary_remote_addr zone=one:30m rate=20r/s;
server {
include ports/*.conf;
include codes/*.conf;
include ssl.conf;
include custom.conf;
index index.php index.html index.htm;
try_files $uri $uri.html $uri/ @extensionless-php;
root /home/xui/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;
# Add global parameters for proxy buffering
proxy_buffering off;
proxy_request_buffering off;
proxy_read_timeout 300s;
proxy_connect_timeout 300s;
proxy_send_timeout 300s;
if ($request_method !~ ^(GET|POST)$) {
return 200;
Now FOR LB one by one same rout
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_xui;
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_xui.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/xui/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;
# Add global parameters for proxy buffering
proxy_buffering off;
proxy_request_buffering off;
proxy_read_timeout 300s;
proxy_connect_timeout 300s;
proxy_send_timeout 300s;
JUST THAT LINES, what it does?
Additional details:
proxy_buffering off;: Prevents Nginx from buffering data in proxy responses.
proxy_request_buffering off;: Disables buffering for incoming requests.
chunked_transfer_encoding on;: Ensures data is sent in chunks .
proxy_read_timeout 300s;, proxy_connect_timeout 300s;, proxy_send_timeout 300s;: Set these values to 300 seconds or more to handle long connections, especially important when clients consume streams.
These changes should help stabilize connections on LBs and allow for a more consistent flow of data for streams.
finally on every edit use this command to refresh nginx
sudo /home/xui/bin/nginx/sbin/nginx -s reload
Because Xtream Codes already correctly implements many of these configurations by default:
It has long keepalive times.
It disables chunked transfer for streams.
It handles proxy buffering correctly.
It performs finer-grained balancing.
And it separates PHP and stream handlers, isolating loads.
In XUI, everything is centralized in a single nginx.conf, and if it's not fine-grained... it crashes.
With these XUI tweaks:
You reduce dropouts of 10-20 seconds.
You avoid timeout errors due to high preload.
You improve the stability of live IPTV connections.
You reduce automatic client reconnections due to poorly managed buffers.
first we need to go here /home/xui/bin/nginx/conf/ im using mobxterm so i edit wit his own editor, important, always doa backup from original file nginx.conf
i have replace text http till server and it leave like that
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
reset_timedout_connection on;
include gzip.conf;
fastcgi_read_timeout 200;
access_log off;
error_log /dev/null;
keepalive_timeout 120;
include balance.conf;
send_timeout 20m;
proxy_read_timeout 300s;
proxy_connect_timeout 300s;
proxy_send_timeout 300s;
sendfile_max_chunk 1m;
lingering_close off;
aio threads=pool_xui;
client_body_timeout 13s;
client_header_timeout 13s;
client_max_body_size 8m;
proxy_buffer_size 16k;
proxy_busy_buffers_size 24k;
proxy_buffers 64 4k;
proxy_max_temp_file_size 0;
real_ip_header X-Forwarded-For;
include realip_cdn.conf;
include realip_cloudflare.conf;
include realip_xui.conf;
include limit.conf;
limit_req_zone $binary_remote_addr zone=one:30m rate=20r/s;
server {
include ports/*.conf;
include codes/*.conf;
include ssl.conf;
include custom.conf;
index index.php index.html index.htm;
try_files $uri $uri.html $uri/ @extensionless-php;
root /home/xui/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;
# Add global parameters for proxy buffering
proxy_buffering off;
proxy_request_buffering off;
proxy_read_timeout 300s;
proxy_connect_timeout 300s;
proxy_send_timeout 300s;
if ($request_method !~ ^(GET|POST)$) {
return 200;
Now FOR LB one by one same rout
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_xui;
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_xui.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/xui/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;
# Add global parameters for proxy buffering
proxy_buffering off;
proxy_request_buffering off;
proxy_read_timeout 300s;
proxy_connect_timeout 300s;
proxy_send_timeout 300s;
JUST THAT LINES, what it does?
Additional details:
proxy_buffering off;: Prevents Nginx from buffering data in proxy responses.
proxy_request_buffering off;: Disables buffering for incoming requests.
chunked_transfer_encoding on;: Ensures data is sent in chunks .
proxy_read_timeout 300s;, proxy_connect_timeout 300s;, proxy_send_timeout 300s;: Set these values to 300 seconds or more to handle long connections, especially important when clients consume streams.
These changes should help stabilize connections on LBs and allow for a more consistent flow of data for streams.
finally on every edit use this command to refresh nginx
sudo /home/xui/bin/nginx/sbin/nginx -s reload
Because Xtream Codes already correctly implements many of these configurations by default:
It has long keepalive times.
It disables chunked transfer for streams.
It handles proxy buffering correctly.
It performs finer-grained balancing.
And it separates PHP and stream handlers, isolating loads.
In XUI, everything is centralized in a single nginx.conf, and if it's not fine-grained... it crashes.
With these XUI tweaks:



