From ab2f472c2af947c6fec16b22d8e9543b6a2f44e4 Mon Sep 17 00:00:00 2001 From: Shihaam Abdul Rahman Date: Fri, 6 Jun 2025 18:32:48 +0500 Subject: [PATCH] nginx config --- nginx/nginx.conf | 53 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 nginx/nginx.conf diff --git a/nginx/nginx.conf b/nginx/nginx.conf new file mode 100644 index 0000000..538b0c4 --- /dev/null +++ b/nginx/nginx.conf @@ -0,0 +1,53 @@ +map $http_user_agent $is_browser { + default 0; + "~*Mozilla" 1; + "~*Chrome" 1; + "~*Safari" 1; + "~*Firefox" 1; + "~*Edge" 1; + "~*Opera" 1; + "~*Brave" 1; +} + +server { + listen 80; + server_name _; + + root /var/www/html; + index index.html; + + location = / { + if ($is_browser = 1) { + rewrite ^ /index.html break; + } + rewrite ^ /index.m3u break; + } + + location /tvm { + include /etc/nginx/redirects/tvm.conf; + } + location /psmnews { + include /etc/nginx/redirects/psmnews.conf; + } + location /yestv { + include /etc/nginx/redirects/yestv.conf; + } + location /munaaru { + include /etc/nginx/redirects/munaaru.conf; + } + location = /dhaaristv { + include /etc/nginx/redirects/dhaaristv.conf; + } + location = /madhinalive { + include /etc/nginx/redirects/madhinalive.conf; + } + location = /makkahlive { + include /etc/nginx/redirects/makkahlive.conf; + } + location = /emanchannel { + include /etc/nginx/redirects/emanchannel.conf; + } + location = /sangutv { + include /etc/nginx/redirects/sangutv.conf; + } +}