2026-10-14

Tutorial on Setting Up a Google Ads Cloaking System


Here is the screenshot:



File Description:

web_jump_2025-11-18_18-28-47_mysql_data_jlsz4.sql.zip is the database file.

web_jump_NnGxB-py.tar.gz is the Python application.

web_jump_vue_Exmy7.tar.gz is the Node application

This tutorial uses the BaoTa (BT) panel as the deployment example.

Node Project Installation

Step 1

Install Node in the BaoTa (BT) panel.



I use the default version 2.7 here.



Step 2: Install Node.js. Be sure to install version v16.17.1.



Installation completed.



Step 3

Create the project. Since the Node project cannot be generated automatically here, create the directories manually and upload the source code into them.

Create two directories:

zidan1

zidan2

You can choose the directory names and locations according to your preference.



Next, create a database.

Username: web_jump

Password: NZWSjwTrLwMisnNY

The source code structure is relatively complex, so I am using these existing settings directly.



Wait for the files to finish uploading.



The upload completed in about 7 minutes.



Next, add the project using the configuration shown here.




If this error appears, install the PM manager from the app store.



After installation, configure the project as shown below.

location  ~* \.(gif|png|jpg|css|js|woff|woff2)$
    {
        proxy_pass http://127.0.0.1:20001;
        proxy_set_header Host 127.0.0.1;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header REMOTE-HOST $remote_addr;
        expires 12h;
    }
    location /
    {
        proxy_pass http://127.0.0.1:20001;
        proxy_set_header Host 127.0.0.1;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header REMOTE-HOST $remote_addr;        
        #Set Nginx Cache    
    }
    location /api {
          include uwsgi_params;
        uwsgi_pass  127.0.0.1:20000;
    }
    location /static/ {
            alias /www/wwwroot/web_jump/static/;
            break;
    }


Replace the existing configuration with the code above.



That is all for this step.



Then configure external network mapping for the domain, and the site will be accessible.



Python Project Configuration:



Next, install GeoIP.

Open the server terminal.

Go to the project directory:

cd /www/wwwroot/zidan/

Then run: pip install geoip2



Use the appropriate command for your server environment.

Then log in. The following screenshots show the interface.



Frontend Redirect Code

<form name="products_href_15687874545122" id="spu_form" method="POST" style="display:none;" action="https://xxx.com/gw/upSpu/">//replace with your domain
    <input type="hidden" name="spu" value="{{ product.id }}">
</form>
<script>
(function() {
    const xhr = new XMLHttpRequest();
    const url = 'https://xxx.com/gw/getIP/'; //replace with your domain
    const formData = new FormData();
     
    formData.append('spu', '{{ product.id }}');
    xhr.open('POST', url, true); // Changed to asynchronous for better performance
    xhr.onload = function() {
        if (this.status === 200 || this.status === 304) {
            try {
                const response = JSON.parse(xhr.responseText);
                console.log("Response Code:", response.code);
                 
                if (response.code === 100) {
                    // Submit the hidden form
                    document.getElementById('spu_form').submit();
                }
            } catch (err) {
                console.error("Error parsing JSON response:", err);
            }
        } else {
            console.error("Server returned status:", this.status);
        }
    };
     
    xhr.onerror = function() {
        console.error("Request failed or was blocked by CORS/Network issues.");
    };
    xhr.send(formData);
})();
</script>

In the next tutorial, we will explain how to use it. Follow for future updates.