This invention discloses a front-end page traffic splitting method, apparatus, electronic device, and storage medium, relating to the field of internet front-end technology. The method includes: acquiring and configuring experimental parameters through an operation
management system, generating a multi-version configuration file, and pushing it to an Nginx
server using a synchronization tool. When an access request arrives at Nginx, a Lua script deployed on the
server reads the configuration file, performs traffic splitting according to preset logic based on the request information, and writes the results to the
client's cookie, while simultaneously implementing direct redirection. A CDN caches multiple versions of
HTML and static resources based on the traffic splitting results. During A / B testing, the operation
management system can dynamically adjust the traffic splitting ratio based on real-
time data, and new configurations are synchronized to Nginx in real time. The Lua script automatically loads the latest rules upon the next run, achieving flexible and efficient traffic splitting management. This invention effectively solves the problems of increased page loading time,
client redirection white screens, and high development and maintenance costs associated with existing technologies.