From 2b035df6a89aa4374ad039ef26345581cda5e6e2 Mon Sep 17 00:00:00 2001 From: Wildan M Date: Sun, 15 Dec 2024 15:39:02 +0700 Subject: [PATCH] Add additional if for free domain --- src/executor/nginx.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/executor/nginx.js b/src/executor/nginx.js index a494e5f..093ba5a 100644 --- a/src/executor/nginx.js +++ b/src/executor/nginx.js @@ -197,9 +197,11 @@ class NginxExecutor { } node.location[idx]._add('if', `($http_referer !~ "^https?://${info.dom}")`); node.location[idx].if[0]._add('rewrite', '^ /deceptive.html last'); - let loc = node._add('location', '= /deceptive.html', []); - loc.location[loc.location.length - 1]._add('root', '/usr/local/share/www') - loc.location[loc.location.length - 1]._add('internal') + node._add('location', '= /deceptive.html', []); + const iloc = node.location[node.location.length - 1] + iloc._add('if', `($http_user_agent ~ "^Mozilla")`); + iloc.if[0]._add('root', '/usr/local/share/www'); + iloc._add('internal'); } } /**