server {
	index index.php index.html index.htm;
	root /var/www/html/;
	server_tokens off;
	listen 80;
	chunked_transfer_encoding off;
	server_name ProxyServer;
	
	location / {
        proxy_pass http://localhost:8080;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }
	
	#Smart TV
	location ~ ^/smarttv/([a-z\/]+)/js/(.*).js$ {
		return 301 /index.php;
	}

	#Loader
	location /loader.js {
		return 301 /index.php;
	}

	#IVI
	location ~ ^/vision.+/bundle\.js$ {
		return 301 /index.php;
	}

	#SS-IPTV
	location /tv.js {
		if ($http_host ~ "app.ss-iptv.com") {
			return 301 /index.php;
		}
	}

	#Portal
	location ~ ^/static/portal/standalone\.js$ {
		return 301 /index.php;
	}

	#Duplex IPTV
	location ~ ^/apps/DuplexIPTV/(.*).js$ {
		return 301 /index.php;
	}

	#TV3
	location ~ ^/iptv/smarttv/(.*).js$ {
		return 301 /index.php;
	}

	#IPTV
	location ~ ^/iptv/smarttv/(.*).html$ {
		return 301 /index.php;
	}

	#Live
	location ~ ^/(.*)/live/(.*)$ {
		return 301 /index.php;
	}

	#Movie
	location ~ ^/(.*)/movie/(.*)$ {
		return 301 /index.php;
	}

	#Series
	location ~ ^/(.*)/series/(.*)$ {
		return 301 /index.php;
	}
	
	#PHP-FPM
	location ~ \.php$ {	
		try_files $uri =404;
		fastcgi_index index.php;
		fastcgi_pass unix:/run/php/php8.2-fpm.sock;
		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;		
	}
	
}