A method, apparatus, electronic device and storage medium for transparent transmission of IP addresses

By modifying the configuration parameters of the load balancing hardware, reverse proxy server, and server, the client IP address can be passed through, solving the problem that the server cannot obtain the real IP address, improving the efficiency of IP address passing through, and supporting UV and PV metric analysis.

CN116915740BActive Publication Date: 2026-05-26CHINA BOHAI BANK CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHINA BOHAI BANK CO LTD
Filing Date
2023-07-07
Publication Date
2026-05-26

AI Technical Summary

Technical Problem

In load balancing scenarios, the server cannot obtain the client's real IP address, resulting in access control becoming unavailable.

Method used

By modifying the configuration parameters of the load balancing hardware, reverse proxy server, and server, the client's IP address can be passed through. This includes setting the IP address and configuration parameters of the reverse proxy server in the load balancing hardware, configuring the request header and request body information in the reverse proxy server, and modifying the display format of the server's running logs.

Benefits of technology

The server can easily view the client's real IP address, improving the efficiency of IP address pass-through. It can also view the IP addresses of other devices, which helps in analyzing UV and PV metrics and counting visits.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116915740B_ABST
    Figure CN116915740B_ABST
Patent Text Reader

Abstract

This application provides an IP address pass-through method, apparatus, electronic device, and storage medium, comprising: modifying the configuration parameters of a load balancing hardware device, a reverse proxy server, and a server based on a configuration parameter change instruction adapted for IP address pass-through, to obtain the load balancing hardware device, reverse proxy server, and server after the configuration parameters have been modified; receiving an access request from a client, the client's IP address, and the IP address of the load balancing hardware device after the configuration parameters have been modified, sent by the load balancing hardware device after the configuration parameters have been modified, and pass-through the access request, the client's IP address, the IP address of the load balancing hardware device after the configuration parameters have been modified, and the IP address of the reverse proxy server after the configuration parameters have been modified, to the server, thereby enabling the server to more conveniently view the real IP address of the accessing client and improving the efficiency of real IP address pass-through.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of information and communication technology, and in particular to a method, apparatus, electronic device and storage medium for transparently transmitting the IP address of a client. Background Technology

[0002] Load balancing using F5 devices (i.e., load balancing hardware) allows for the translation of client source address information. This means the backend servers connected to the load balancer see the translated IP (Internet Protocol) address, not the client's actual IP address. Some applications rely on lists of client IP addresses for access control, using Access Control Lists (ACLs). In this scenario, the server cannot obtain the client's real IP address, rendering the service unavailable. Therefore, obtaining the client's real IP address on the server side becomes a significant technical challenge. Summary of the Invention

[0003] In view of this, the purpose of this application is to provide a method, device, electronic device and storage medium for transparently transmitting the IP address of a client, which enables the server to not only more conveniently view the real IP address of the accessing client, but also improve the efficiency of transparently transmitting the real IP address, and also view the IP address of other devices, which is beneficial for analyzing UV and PV indicators and counting the number of client visits.

[0004] This application provides a method for transparently transmitting IP addresses for a client, applied to a reverse proxy server in an IP address transparent transmission system. The IP address transparent transmission system further includes a client, a load balancing hardware device, and a server. The IP address transparent transmission method includes:

[0005] Based on the configuration parameter change instruction of the adapted IP address pass-through, the configuration parameters of the load balancing hardware device, the reverse proxy server and the server are changed to obtain the load balancing hardware device, the reverse proxy server and the server after the configuration parameters are changed.

[0006] The server receives the access request from the client, the client's IP address, and the IP address of the load balancing hardware device after the configuration parameters have been changed, sent by the load balancing hardware device after the configuration parameters have been changed. The server then forwards the access request, the client's IP address, the IP address of the load balancing hardware device after the configuration parameters have been changed, and the IP address of the reverse proxy server after the configuration parameters have been changed to the server.

[0007] This is so that the server's operation log after the configuration parameters are changed will display the IP address of the load balancing hardware device, the IP address of the client, and the IP address of the reverse proxy server after the configuration parameters are changed.

[0008] In one possible implementation, the configuration parameter change instruction based on adapted IP address pass-through modifies the configuration parameters of the load balancing hardware device, the reverse proxy server, and the server to obtain the load balancing hardware device, the reverse proxy server, and the server after the configuration parameters have been changed, including:

[0009] The IP address of the reverse proxy server is set in the load balancing hardware device and the configuration parameters are changed to determine the load balancing hardware device after the configuration parameters are changed.

[0010] The reverse proxy server is configured with changes to the server's IP address and configuration parameters to determine the reverse proxy server after the configuration parameters have been changed.

[0011] The display format of the server's operation log is modified to determine the server after the configuration parameters are changed.

[0012] In one possible implementation, the step of setting the IP address of the reverse proxy server and changing the configuration parameters in the load balancing hardware device, and determining the load balancing hardware device after the configuration parameters have been changed, includes:

[0013] Configure a data pool in the load balancing hardware device, and add the IP address and port of the reverse proxy server to the data pool;

[0014] The newly created configuration file is identified, and the XFF header is enabled on the load balancing hardware device. The configuration file is then associated with the virtual server of the load balancing hardware device, and the load balancing hardware device after the configuration parameters have been changed is identified.

[0015] In one possible implementation, the step of setting the IP address and configuration parameters of the server in the reverse proxy server, and determining the reverse proxy server after the configuration parameters have been changed, includes:

[0016] Configure the reverse proxy server with parameters corresponding to the IP address and port of the server to forward the access request.

[0017] Configure request header information and request body information in the reverse proxy server, wherein the request header information is used to store the IP address of the client;

[0018] Configure the reverse proxy server to obtain the modified IP address of the load balancing hardware device and save the parameters corresponding to the IP address of the reverse proxy server, and configure the XFF header in the reverse proxy server to identify the reverse proxy server after the configuration parameters have been modified.

[0019] In one possible implementation, modifying the display format of the server's runtime logs to determine the server after the configuration parameters have been changed includes:

[0020] The display format of the server's operation log is modified to obtain the client's IP address and display the corresponding format in its entirety, thereby determining the server after the configuration parameters have been changed.

[0021] In one possible implementation, the newly created configuration file is determined in the following way:

[0022] Obtain historical configuration files, modify the configuration parameters on the historical configuration files, and determine the newly created configuration file;

[0023] Alternatively, create a new HTTP configuration file locally on the load balancing hardware device.

[0024] This application embodiment also provides a client-side IP address pass-through device, applied to a reverse proxy server in an IP address pass-through system. The IP address pass-through system further includes a client, a load balancing hardware device, and a server. The IP address pass-through device includes:

[0025] The parameter modification module is used to modify the configuration parameters of the load balancing hardware device, the reverse proxy server, and the server based on the configuration parameter modification instructions transmitted through the adapted IP address, so as to obtain the load balancing hardware device, the reverse proxy server, and the server after the configuration parameters are modified.

[0026] The pass-through module is used to receive the access request from the client, the IP address of the client, and the IP address of the load balancing hardware device after the configuration parameters have been changed, sent by the load balancing hardware device after the configuration parameters have been changed, and to pass through the access request, the IP address of the client, the IP address of the load balancing hardware device after the configuration parameters have been changed, and the IP address of the reverse proxy server after the configuration parameters have been changed to the server.

[0027] The display module is used to display the IP address of the load balancing hardware device, the IP address of the client, and the IP address of the reverse proxy server after the configuration parameters have been changed in the running log of the server after the configuration parameters have been changed.

[0028] In one possible implementation, when the parameter changing module modifies the configuration parameters of the load balancing hardware device, the reverse proxy server, and the server using the configuration parameter changing instruction based on the adapted IP address pass-through, to obtain the load balancing hardware device, the reverse proxy server, and the server with modified configuration parameters, the parameter changing module may specifically be used for:

[0029] The IP address of the reverse proxy server is set in the load balancing hardware device and the configuration parameters are changed to determine the load balancing hardware device after the configuration parameters are changed.

[0030] The reverse proxy server is configured with changes to the server's IP address and configuration parameters to determine the reverse proxy server after the configuration parameters have been changed.

[0031] The display format of the server's operation log is modified to determine the server after the configuration parameters are changed.

[0032] In one possible implementation, when the parameter changing module is used to set the IP address of the reverse proxy server and change the configuration parameters in the load balancing hardware device, and to determine the load balancing hardware device after the configuration parameters have been changed, the parameter changing module may specifically be used to:

[0033] Configure a data pool in the load balancing hardware device, and add the IP address and port of the reverse proxy server to the data pool;

[0034] The newly created configuration file is identified, and the XFF header is enabled on the load balancing hardware device. The configuration file is then associated with the virtual server of the load balancing hardware device, and the load balancing hardware device after the configuration parameters have been changed is identified.

[0035] In one possible implementation, when the parameter changing module is used to change the IP address and configuration parameters of the server in the reverse proxy server, and to determine the reverse proxy server after the configuration parameters have been changed, the parameter changing module may specifically be used to:

[0036] Configure the reverse proxy server with parameters corresponding to the IP address and port of the server to forward the access request.

[0037] Configure request header information and request body information in the reverse proxy server, wherein the request header information is used to store the IP address of the client;

[0038] Configure the reverse proxy server to obtain the modified IP address of the load balancing hardware device and save the parameters corresponding to the IP address of the reverse proxy server, and configure the XFF header in the reverse proxy server to identify the reverse proxy server after the configuration parameters have been modified.

[0039] In one possible implementation, when the parameter changing module modifies the display format of the server's runtime logs to determine the server after the configuration parameters have been changed, the parameter changing module may specifically be used to:

[0040] The display format of the server's operation log is modified to obtain the client's IP address and display the corresponding format in its entirety, thereby determining the server after the configuration parameters have been changed.

[0041] In one possible implementation, the parameter changing module determines the newly created configuration file in the following way:

[0042] Obtain historical configuration files, modify the configuration parameters on the historical configuration files, and determine the newly created configuration file;

[0043] Alternatively, create a new HTTP configuration file locally on the load balancing hardware device.

[0044] This application also provides an electronic device, including: a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor communicates with the memory via the bus. When the machine-readable instructions are executed by the processor, the steps of the client IP address pass-through method described above are performed.

[0045] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the steps of the client IP address pass-through method described above.

[0046] This application provides a method, apparatus, electronic device, and storage medium for transparently transmitting a client's IP address. These are applied to a reverse proxy server in an IP address transparent transmission system. The IP address transparent transmission system also includes a client, a load balancing hardware device, and a server. The IP address transparent transmission method includes: modifying the configuration parameters of the load balancing hardware device, the reverse proxy server, and the server based on a configuration parameter change instruction adapted for IP address transparent transmission, resulting in the modified configuration parameters of the load balancing hardware device, the reverse proxy server, and the server; receiving an access request from the client, the client's IP address, and the modified configuration parameter IP address of the load balancing hardware device, and transparently transmitting the access request, the client's IP address, the modified configuration parameter IP address of the load balancing hardware device, and the modified configuration parameter IP address of the reverse proxy server to the server; and displaying the modified configuration parameter IP address of the load balancing hardware device, the client's IP address, and the modified configuration parameter IP address of the reverse proxy server in the server's operation log. This allows for easier viewing of the real IP addresses of accessing clients on the server side, improves the efficiency of real IP address pass-through, and also allows viewing the IP addresses of other devices, which is beneficial for analyzing UV and PV metrics and counting client access volume.

[0047] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description

[0048] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0049] Figure 1 A flowchart illustrating a method for transparently transmitting the IP address of a client, provided in an embodiment of this application;

[0050] Figure 2 This is an interactive schematic diagram of an IP address pass-through system provided in an embodiment of this application;

[0051] Figure 3 A schematic diagram of the structure of a client IP address pass-through device provided in an embodiment of this application;

[0052] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0053] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. It should be understood that the drawings in this application are for illustrative and descriptive purposes only and are not intended to limit the scope of protection of this application. Furthermore, it should be understood that the schematic drawings are not drawn to scale. The flowcharts used in this application illustrate operations implemented according to some embodiments of this application. It should be understood that the operations in the flowcharts may not be implemented in sequence, and steps without logical contextual relationships may be reversed or implemented simultaneously. In addition, those skilled in the art, guided by the content of this application, may add one or more other operations to the flowcharts, or remove one or more operations from the flowcharts.

[0054] Furthermore, the described embodiments are merely some, not all, of the embodiments of this application. The components of the embodiments of this application described and illustrated herein can typically be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of the application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.

[0055] In order to enable those skilled in the art to use the content of this application and in combination with the specific application scenario of "transmitting the IP address of the client", the following implementation method is given. For those skilled in the art, the general principles defined herein can be applied to other embodiments and application scenarios without departing from the spirit and scope of this application.

[0056] The methods, apparatus, electronic devices, or computer-readable storage media described in this application can be applied to any scenario that requires transparent transmission of the client's IP address. This application does not limit the specific application scenario. Any scheme using the method, apparatus, and equipment for determining ground support tasks for multi-station flights provided in this application is within the protection scope of this application.

[0057] First, the applicable scenarios for this application will be introduced. This application can be applied to the field of information and communication technology.

[0058] Research has revealed that load balancing using F5 devices (i.e., load balancing hardware) allows for the translation of client source address information. This means the backend servers connected to the load balancer see the translated IP (Internet Protocol) address, not the client's actual IP address. Some applications rely on client IP addresses for access control (ACLs). In such scenarios, the server cannot obtain the client's real IP address, rendering the service unavailable. Therefore, obtaining the client's real IP address on the server side has become a significant technical challenge.

[0059] Based on this, this application provides a method for transparently transmitting the IP address of a client, which enables the server to not only more conveniently view the real IP address of the accessing client, but also view the IP addresses of other devices, improve the efficiency of transparently transmitting the real IP address, and facilitate the analysis of UV and PV metrics and the statistics of client access volume.

[0060] Please see Figure 1 , Figure 1 This is a flowchart illustrating a method for transparently transmitting a client's IP address, provided as an embodiment of this application. Figure 1 As shown in the figure, the IP address pass-through method provided in this application embodiment includes:

[0061] S101: Based on the configuration parameter change command of the adapted IP address pass-through, the configuration parameters of the load balancing hardware device, reverse proxy server and server are changed to obtain the load balancing hardware device, reverse proxy server and server after the configuration parameters are changed.

[0062] In this step, the configuration parameters of the load balancing hardware device, reverse proxy server, and server are changed according to the configuration parameter change instructions transmitted by the adapted IP address, resulting in the load balancing hardware device, reverse proxy server, and server after the configuration parameters have been changed.

[0063] In one possible implementation, configuration parameters of the load balancing hardware device, reverse proxy server, and server are modified based on configuration parameter change instructions that adapt to IP address pass-through, resulting in the modified load balancing hardware device, reverse proxy server, and server, including the following steps one through three:

[0064] Step 1: Configure the reverse proxy server's IP address and change the configuration parameters in the load balancing hardware device to identify the load balancing hardware device after the configuration parameters have been changed.

[0065] Here, the IP address of the reverse proxy server (nginx) is set in the load balancing hardware device (F5), and the configuration parameters of the load balancing hardware device (F5) are changed to determine the load balancing hardware device after the configuration parameters are changed.

[0066] In one possible implementation, setting the IP address of the reverse proxy server and changing the configuration parameters in the load balancing hardware device, and identifying the load balancing hardware device after the configuration parameter changes, includes the following steps:

[0067] First, configure a data pool in the load balancing hardware device, and add the IP address and port of the reverse proxy server to the data pool.

[0068] Here, in F5, we configure a pool, select HTTP as the health check policy, and add two nginx IP addresses and ports to the pool to achieve load balancing.

[0069] Secondly, identify the newly created configuration file, enable the XFF header on the load balancing hardware device, associate the configuration file with the virtual server of the load balancing hardware device, and identify the load balancing hardware device after changing the configuration parameters.

[0070] Here, a new HTTP configuration file is created, and the XFF header is enabled on the load balancer hardware device. The newly created configuration file is then associated with the virtual server of the load balancer hardware device to enable future changes to the configuration parameters of the load balancer hardware device.

[0071] For example, create a new HTTP configuration file and enable the Insert XFF header. The purpose is to insert the client's source address into the Layer 7 HTTP header. Associate this new HTTP configuration file with the already configured Virtual Server (VS). It's necessary to confirm whether the type on the VS is PerformanceL4 or Standard; if PerformanceL4, it needs to be changed to Standard. This is because F5 requires the Standard mode to modify Layer 7 packets. Here, VS stands for Virtual Server, which is the name of the virtual server provided by F5 when publishing services externally. It is the unified interface for receiving external access, and accessed resources are forwarded to the associated pool in the backend. After the server load is created in the pool, the VS needs to publish it for client access. This allows the backend server to only need to extract the X-Forwarded-For field from the Layer 7 HTTP header to trace the client's real source address.

[0072] In one possible implementation, the newly created configuration file is determined in the following way:

[0073] Retrieve historical configuration files, modify the configuration parameters on the historical configuration files, and determine the new configuration file; alternatively, create a new HTTP-type configuration file locally on the load balancer hardware device.

[0074] One approach is to directly modify the configuration parameters of a historical configuration file to obtain a new configuration file, or to create a new HTTP-type configuration file locally on the load balancer hardware device.

[0075] Step 2: Configure the server's IP address and change the configuration parameters in the reverse proxy server to determine the reverse proxy server after the configuration parameters have been changed.

[0076] Here, the server's IP address is set in the reverse proxy server, and the configuration parameters of the reverse proxy server are changed to determine the reverse proxy server after the configuration parameters are changed.

[0077] In this process, you need to modify the configuration file in nginx, set the server's IP address and port, and then restart the nginx service.

[0078] In one possible implementation, the reverse proxy server is configured with changes to the server's IP address and configuration parameters, and the reverse proxy server after the configuration parameters have been changed is identified, including the following steps (1) to (3):

[0079] (1): Configure the parameters in the reverse proxy server to forward access requests to the corresponding IP address and port of the server.

[0080] Here, the `proxy_pass tomcatIP:port` parameter is set in the `server` module of the `nginx.conf` file. The purpose is to forward the access requests received by nginx to the corresponding IP and port of the server, and it is set to `proxy_pass 192.168.4.112:8080`.

[0081] (2): Configure request header information and request body information in the reverse proxy server. The request header information is used to store the client's IP address.

[0082] Here, in the `server` module of the `nginx.conf` file, `proxy_set_header X-Real-IP $remote_addr` is set. Requests consist of a request header and a request body. The request header stores the client's IP address. `set_header` redefines the request header information and can pass this information to the server. Without setting this parameter, `nginx` obtains the F5 IP address as `remote_addr`. Setting `X-Real-IP` allows `nginx` to obtain the client's IP address.

[0083] (3): Configure the reverse proxy server to obtain the IP address of the changed load balancing hardware device and save the parameters corresponding to the IP address of the reverse proxy server, and configure the XFF header in the reverse proxy server to determine the reverse proxy server after the configuration parameters have been changed.

[0084] Here, in the `server` module of the `nginx.conf` file, `proxy_set_header Remote_addr $remote_addr` is set. This parameter allows nginx to obtain the IP address of F5. `$remote_addr` stores the IP address of the reverse proxy server. Setting `proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for` aims to obtain the real IP address of the HTTP request client. When forwarding, the IP address of the upper-layer proxy will be included. For this solution, the XFF header is configured in F5 and also in the nginx proxy. This parameter can pass the proxy IP when there are multiple proxies. nginx obtains the client IP address and all proxy IP addresses.

[0085] Step 3: Modify the display format of the server's runtime logs to determine the server after changing the configuration parameters.

[0086] Here, the display format of the server's runtime log is modified to obtain the server after the configuration parameters are changed, so that the server's runtime log will display the IP address of the client's load balancing hardware device, the client's IP address, and the IP address of the reverse proxy server after the configuration parameters are changed.

[0087] In one possible implementation, modifying the display format of the server's runtime logs to determine the server after the configuration parameters have been changed includes:

[0088] The display format of the server's operation log is modified to obtain the client's IP address and display the corresponding format in its entirety, thereby determining the server after the configuration parameters have been changed.

[0089] Here, the default IP display format in the server-side runtime log is pattern="%h%l%u%t";%r";%s%b". It needs to be modified to pattern="%h%l%u%t";%{X-Forwarded-For}i%s%b";%{X-Forwarded-For}". This parameter represents obtaining and displaying the client's real IP address.

[0090] S102: Receive the client's access request, the client's IP address, and the IP address of the load balancing hardware device after the configuration parameters have been changed, sent by the load balancing hardware device after the configuration parameters have been changed. Then, forward the access request, the client's IP address, the IP address of the load balancing hardware device after the configuration parameters have been changed, and the IP address of the reverse proxy server after the configuration parameters have been changed to the server.

[0091] In this step, the server, after changing the configuration parameters, receives the client's access request, the client's IP address, and the IP address of the load balancing hardware device after changing the configuration parameters from the client's access request, the client's IP address, the IP address of the load balancing hardware device after changing the configuration parameters, and the IP address of the reverse proxy server after changing the configuration parameters from the client's access request to the server.

[0092] Here, the client accesses the load balancing hardware device after its configuration parameters have been modified. The modified load balancing hardware device then forwards the access request, the IP address of the modified load balancing hardware device, and the client's IP address to the modified reverse proxy server. The modified reverse proxy server then forwards the access request, the modified IP address of the load balancing hardware device, the client's IP address, and the IP address of the modified reverse proxy server to the modified server. The server's runtime log displays the IP address of the modified load balancing hardware device, the client's IP address, and the IP address of the modified reverse proxy server.

[0093] S103: To display the IP address of the load balancing hardware device, the client's IP address, and the reverse proxy server's IP address in the server's runtime log after the configuration parameters have been changed.

[0094] In this step, the server's runtime log after the configuration parameters have been changed will display the IP address of the load balancing hardware device, the client's IP address, and the reverse proxy server's IP address after the configuration parameters have been changed, so that operations and maintenance personnel can find them.

[0095] For further details, please refer to Figure 2 , Figure 2 This is a schematic diagram illustrating the interaction of an IP address pass-through system provided in an embodiment of this application. Figure 2 As shown, the client accesses the load balancer hardware device (F5) after its configuration parameters have been modified. The modified load balancer hardware device (F5) then forwards the access request, the IP address of the modified load balancer hardware device (192.168.200.70), and the client's IP address (192.168.11.165 / 166) to the modified reverse proxy server (nginx). The modified reverse proxy server (nginx) then forwards the access request, the IP address of the modified load balancer hardware device (192.168.200.70), and the client's IP address (192.168.11.165 / 166) to the reverse proxy server (nginx). The IP addresses of the client (192.168.11.165 / 166) and the reverse proxy server (192.168.11.168 / 169) after the configuration parameters have been changed are passed through to the server (Tomcat) after the configuration parameters have been changed. The running log of the server after the configuration parameters have been changed displays the IP address of the load balancing hardware device after the configuration parameters have been changed, the IP address of the client, and the IP address of the reverse proxy server after the configuration parameters have been changed. Here, the IP address of the server is 192.168.4.112 / 113.

[0096] This application provides a method for transparently transmitting a client's IP address, applied to a reverse proxy server in an IP address transparent transmission system. The IP address transparent transmission system also includes a client, a load balancing hardware device, and a server. The IP address transparent transmission method includes: modifying the configuration parameters of the load balancing hardware device, the reverse proxy server, and the server based on a configuration parameter change instruction adapted for IP address transparent transmission, obtaining the modified load balancing hardware device, the reverse proxy server, and the server; receiving the client's access request, the client's IP address, and the modified load balancing hardware device's IP address from the modified load balancing hardware device, and transparently transmitting the access request, the client's IP address, the modified load balancing hardware device's IP address, and the modified reverse proxy server's IP address to the server; so that the modified load balancing hardware device's IP address, the client's IP address, and the modified reverse proxy server's IP address are displayed in the server's operation log. This allows for easier viewing of the real IP addresses of accessing clients on the server side, improves the efficiency of real IP address pass-through, and also allows viewing the IP addresses of other devices, which is beneficial for analyzing UV and PV metrics and counting client access volume.

[0097] Please see Figure 3 , Figure 3 This is a schematic diagram of a client-side IP address pass-through device provided in an embodiment of this application. The IP address pass-through device 300 can be applied to a reverse proxy server in an IP address pass-through system. The IP address pass-through system may also include a client, a load balancing hardware device, and a server, such as… Figure 3 As shown, the IP address pass-through device 300 includes:

[0098] The parameter modification module 310 is used to modify the configuration parameters of the load balancing hardware device, the reverse proxy server, and the server based on the configuration parameter modification instruction transmitted through the adapted IP address, so as to obtain the load balancing hardware device, the reverse proxy server, and the server after the configuration parameters are modified.

[0099] The pass-through module 320 is used to receive the access request from the client, the IP address of the client, and the IP address of the load balancing hardware device after the configuration parameters have been changed, sent by the load balancing hardware device after the configuration parameters have been changed, and to pass through the access request, the IP address of the client, the IP address of the load balancing hardware device after the configuration parameters have been changed, and the IP address of the reverse proxy server after the configuration parameters have been changed to the server.

[0100] The display module 330 is used to display the IP address of the load balancing hardware device, the IP address of the client, and the IP address of the reverse proxy server after the configuration parameters have been changed in the running log of the server after the configuration parameters have been changed.

[0101] Furthermore, when the parameter changing module 310 modifies the configuration parameters of the load balancing hardware device, the reverse proxy server, and the server using the configuration parameter changing instruction based on the adapted IP address pass-through, to obtain the load balancing hardware device, the reverse proxy server, and the server with modified configuration parameters, the parameter changing module 310 can specifically be used for:

[0102] The IP address of the reverse proxy server is set in the load balancing hardware device and the configuration parameters are changed to determine the load balancing hardware device after the configuration parameters are changed.

[0103] The reverse proxy server is configured with changes to the server's IP address and configuration parameters to determine the reverse proxy server after the configuration parameters have been changed.

[0104] The display format of the server's operation log is modified to determine the server after the configuration parameters are changed.

[0105] Furthermore, when the parameter changing module 310 is used to set the IP address of the reverse proxy server and change the configuration parameters in the load balancing hardware device, and to determine the load balancing hardware device after the configuration parameters have been changed, the parameter changing module 310 can be specifically used for:

[0106] Configure a data pool in the load balancing hardware device, and add the IP address and port of the reverse proxy server to the data pool;

[0107] The newly created configuration file is identified, and the XFF header is enabled on the load balancing hardware device. The configuration file is then associated with the virtual server of the load balancing hardware device, and the load balancing hardware device after the configuration parameters have been changed is identified.

[0108] Furthermore, when the parameter changing module 310 is used to change the IP address and configuration parameters of the server in the reverse proxy server, and to determine the reverse proxy server after the configuration parameters have been changed, the parameter changing module 310 can be specifically used for:

[0109] Configure the reverse proxy server with parameters corresponding to the IP address and port of the server to forward the access request.

[0110] Configure request header information and request body information in the reverse proxy server, wherein the request header information is used to store the IP address of the client;

[0111] Configure the reverse proxy server to obtain the modified IP address of the load balancing hardware device and save the parameters corresponding to the IP address of the reverse proxy server, and configure the XFF header in the reverse proxy server to identify the reverse proxy server after the configuration parameters have been modified.

[0112] Furthermore, when the parameter changing module 310 modifies the display format of the server's running logs to determine the server after the configuration parameters have been changed, the parameter changing module 310 can specifically be used to:

[0113] The display format of the server's operation log is modified to obtain the client's IP address and display the corresponding format in its entirety, thereby determining the server after the configuration parameters have been changed.

[0114] Furthermore, the parameter modification module 310 determines the newly created configuration file in the following way:

[0115] Obtain historical configuration files, modify the configuration parameters on the historical configuration files, and determine the newly created configuration file;

[0116] Alternatively, create a new HTTP configuration file locally on the load balancing hardware device.

[0117] This application provides a client IP address pass-through device, comprising: a parameter modification module, configured to modify the configuration parameters of a load balancing hardware device, a reverse proxy server, and a server based on a configuration parameter modification instruction adapted for IP address pass-through, to obtain the load balancing hardware device, the reverse proxy server, and the server after the configuration parameters have been modified; a pass-through module, configured to receive the client's access request, the client's IP address, and the IP address of the load balancing hardware device after the configuration parameters have been modified, sent by the load balancing hardware device after the configuration parameters have been modified, and pass-through the access request, the client's IP address, the IP address of the load balancing hardware device after the configuration parameters have been modified, and the IP address of the reverse proxy server after the configuration parameters have been modified, to the server; and a display module, configured to display the IP address of the load balancing hardware device, the client's IP address, and the IP address of the reverse proxy server after the configuration parameters have been modified in the server's operation log. This allows for easier viewing of the real IP addresses of accessing clients on the server side, improves the efficiency of real IP address pass-through, and also allows viewing the IP addresses of other devices, which is beneficial for analyzing UV and PV metrics and counting client access volume.

[0118] Please see Figure 4 , Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 4 As shown, the electronic device 400 includes a processor 410, a memory 420, and a bus 430.

[0119] The memory 420 stores machine-readable instructions executable by the processor 410. When the electronic device 400 is running, the processor 410 communicates with the memory 420 via the bus 430. When the machine-readable instructions are executed by the processor 410, they can perform the operations described above. Figure 1 The steps of the client's IP address pass-through method in the illustrated method embodiment can be found in the method embodiment for specific implementation details, which will not be repeated here.

[0120] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, can perform the above-described actions. Figure 1 The steps of the client's IP address pass-through method in the illustrated method embodiment can be found in the method embodiment for specific implementation details, which will not be repeated here.

[0121] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0122] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the shown or discussed mutual couplings, direct couplings, or communication connections may be through some communication interfaces; indirect couplings or communication connections between devices or units may be electrical, mechanical, or other forms.

[0123] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0124] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0125] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a processor-executable, non-volatile, computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0126] Finally, it should be noted that the above-described embodiments are merely specific implementations of this application, used to illustrate the technical solutions of this application, and not to limit them. The scope of protection of this application is not limited thereto. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features, within the scope of the technology disclosed in this application. Such modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be covered within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A method for transparently transmitting the IP address of a client, characterized in that, A reverse proxy server is used in an IP address pass-through system, which further includes a client, a load balancing hardware device, and a server. The IP address pass-through method includes: Based on the configuration parameter change instruction of the adapted IP address pass-through, the configuration parameters of the load balancing hardware device, the reverse proxy server and the server are changed to obtain the load balancing hardware device, the reverse proxy server and the server after the configuration parameters are changed. The configuration parameter change instruction based on the adapted IP address pass-through modifies the configuration parameters of the load balancing hardware device, the reverse proxy server, and the server, resulting in the modified configuration parameters of the load balancing hardware device, the reverse proxy server, and the server, including: The IP address of the reverse proxy server is set in the load balancing hardware device and the configuration parameters are changed to determine the load balancing hardware device after the configuration parameters are changed. The reverse proxy server is configured with changes to the server's IP address and configuration parameters to determine the reverse proxy server after the configuration parameters have been changed. Modify the display format of the server's operation log to determine the server after the configuration parameters have been changed; The server receives the access request from the client, the client's IP address, and the modified IP address of the load balancing hardware device after the configuration parameters have been changed, sent by the load balancing hardware device. It then forwards the access request, the client's IP address, the modified IP address of the load balancing hardware device, and the modified IP address of the reverse proxy server to the server. This ensures that the modified IP address of the load balancing hardware device, the client's IP address, and the modified IP address of the reverse proxy server are displayed in the server's operation log.

2. The IP address pass-through method according to claim 1, characterized in that, The step of setting the IP address of the reverse proxy server and changing the configuration parameters in the load balancing hardware device, and determining the load balancing hardware device after changing the configuration parameters, includes: Configure a data pool in the load balancing hardware device, and add the IP address and port of the reverse proxy server to the data pool; The newly created configuration file is identified, and the XFF header is enabled on the load balancing hardware device. The configuration file is then associated with the virtual server of the load balancing hardware device, and the load balancing hardware device after the configuration parameters have been changed is identified.

3. The IP address pass-through method according to claim 1, characterized in that, The step of setting the IP address and configuration parameters of the server in the reverse proxy server, and determining the reverse proxy server after the configuration parameters have been changed, includes: Configure the reverse proxy server with parameters corresponding to the IP address and port of the server to forward the access request. Configure request header information and request body information in the reverse proxy server, wherein the request header information is used to store the IP address of the client; Configure the reverse proxy server to obtain the modified IP address of the load balancing hardware device and save the parameters corresponding to the IP address of the reverse proxy server, and configure the XFF header in the reverse proxy server to identify the reverse proxy server after the configuration parameters have been modified.

4. The IP address pass-through method according to claim 1, characterized in that, Modifying the display format of the server's runtime logs to determine the server after the configuration parameters have been changed includes: The display format of the server's operation log is modified to obtain the client's IP address and display the corresponding format in its entirety, thereby determining the server after the configuration parameters have been changed.

5. The IP address pass-through method according to claim 2, characterized in that, The newly created configuration file is determined in the following way: Obtain historical configuration files, modify the configuration parameters on the historical configuration files, and determine the newly created configuration file; Alternatively, create a new HTTP configuration file locally on the load balancing hardware device.

6. A client IP address pass-through device, characterized in that, A reverse proxy server used in an IP address pass-through system, the IP address pass-through system also including a client, a load balancing hardware device, and a server, the IP address pass-through device including: The parameter modification module is used to modify the configuration parameters of the load balancing hardware device, the reverse proxy server, and the server based on the configuration parameter modification instructions transmitted through the adapted IP address, so as to obtain the load balancing hardware device, the reverse proxy server, and the server after the configuration parameters are modified. Specifically, when the parameter changing module modifies the configuration parameters of the load balancing hardware device, the reverse proxy server, and the server using the configuration parameter changing instruction based on the adapted IP address pass-through, to obtain the load balancing hardware device, the reverse proxy server, and the server with modified configuration parameters, the parameter changing module can be used to: The IP address of the reverse proxy server is set in the load balancing hardware device and the configuration parameters are changed to determine the load balancing hardware device after the configuration parameters are changed. The reverse proxy server is configured with changes to the server's IP address and configuration parameters to determine the reverse proxy server after the configuration parameters have been changed. Modify the display format of the server's operation log to determine the server after the configuration parameters have been changed; The pass-through module is used to receive the access request from the client, the IP address of the client, and the IP address of the load balancing hardware device after the configuration parameters have been changed, sent by the load balancing hardware device after the configuration parameters have been changed, and to pass through the access request, the IP address of the client, the IP address of the load balancing hardware device after the configuration parameters have been changed, and the IP address of the reverse proxy server after the configuration parameters have been changed to the server. The display module is used to display the IP address of the load balancing hardware device, the IP address of the client, and the IP address of the reverse proxy server after the configuration parameters have been changed in the server's operation log.

7. An electronic device, characterized in that, include: The device includes a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor communicates with the memory via the bus. The machine-readable instructions are executed by the processor to perform the steps of the client's IP address pass-through method as described in any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, performs the steps of the client IP address pass-through method as described in any one of claims 1 to 5.