An Nginx-based WebApp dynamic proxy system
By using an Nginx-based WebApp dynamic proxy system, which leverages unique identifiers and a hot-reload mechanism, a single IP address and port can be used to proxy multiple WebApps. This solves the configuration complexity and maintenance costs associated with Nginx reverse proxies, and improves the system's flexibility and efficiency.
Patent Information
- Application Number
- CN202411056191.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-02
- Publication Date
- 2026-01-23
- Estimated Expiration
- 2044-08-02
AI Technical Summary
In a cloud network environment, when using Nginx reverse proxy, how can we achieve proxying of multiple WebApps with a single IP and port to reduce usage and maintenance costs? The configuration process is cumbersome and difficult to dynamically adapt to changes in business systems.
Design an Nginx-based WebApp dynamic proxy system, including an Nginx proxy module, a WebApp management platform, and a configuration refresh module. By generating a unique server_name identifier, combined with a visual interface and a hot reloading mechanism, the system automatically updates the Nginx configuration to achieve dynamic proxying.
It enables flexible proxying of multiple WebApps through a single IP and port, reducing configuration complexity and operation and maintenance costs, improving system scalability and work efficiency, and allowing for rapid access and exit to adapt to business changes.
Smart Images

Figure CN118945031B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application relates to the technical field of software development, in particular to a WebApp dynamic proxy system based on Nginx. BACKGROUND
[0002] In some cloud-based network environments, the IP and port that can be publicly accessed may be fixed, and if a certain number of business systems need to be accessed, Nginx is generally used for reverse proxy. Using Nginx reverse proxy can not focus on the real address of the business system, and only needs to ensure that the Nginx reverse proxy server and the business information network are reachable, and also supports load balancing, caching and other functions, but generally reverse proxy is achieved by using different ports or different location blocks, if only one port can be listened to and different business systems have no clear context distinction, it needs to be realized through request headers, client IP, server_name and other ways, which is relatively cumbersome, and each time a new business system is connected or exited, it needs to be configured complicatedly, and the purpose of dynamic proxy cannot be achieved.
[0003] How to realize single IP and port proxy for multiple WebApp based on Nginx reverse proxy to reduce use cost and operation and maintenance cost is a technical problem to be solved. SUMMARY
[0004] The technical task of the application is to provide a WebApp dynamic proxy system based on Nginx to solve the technical problem of how to realize single IP and port proxy for multiple WebApp based on Nginx reverse proxy to reduce use cost and operation and maintenance cost.
[0005] The application provides a WebApp dynamic proxy system based on Nginx, which is used for realizing proxy service for multiple business system WebAPP through one IP and port, and comprises an Nginx proxy module, a WebApp management platform and a configuration refreshing module.
[0006] The Nginx proxy module is arranged on a server capable of being publicly accessed, and is used for providing default configuration of Nginx proxy and template configuration of WebAPP access.
[0007] The WebApp management platform interacts with the administrator through a WebAPP management interface, and provides login authentication services and management operations of the WebAPP through the WebAPP management interface, the management operations of the WebAPP including access, exit, addition, modification and deletion operations of the WebAPP, for generating a unique identifier server_name for the accessed WebAPP, for forming and displaying a WebAPP list and a Web application of each WebAPP;
[0008] The configuration refreshing module is configured to provide an adding and deleting service of an Nginx proxy module configuration file and a hot loading operation of the Ngeinx proxy application.
[0009] Preferably, the Nginx proxy module installs or starts the Nginx service in the form of an rpm package or a docker image, and supports the http protocol.
[0010] Preferably, the default configuration of the Nginx proxy includes:
[0011] The Nginx default configuration file is modified to refer to all conf files in the / etc / nginx / conf.d / directory.
[0012] A unique port is set to be listened to, and a certificate needs to be set if the https port is listened to, and the certificate can be configured as a self-signed certificate.
[0013] The server_name is limited to be not empty, and if the server_name is empty, 403 Forbidden is returned.
[0014] The server_name is limited to exist, and if the server_name does not exist, 403 Forbidden is returned.
[0015] Preferably, the Nginx proxy module supports template configuration of the WebAPP, including:
[0016] A template file conf.template is newly created, and the content is a listening service for a unique port.
[0017] The server_name, the certificate, the private key and the proxy_pass value of the WebAPP are set as corresponding placeholders #server_name#, #server.crt#, #server.key# and #proxy_pass#.
[0018] Preferably, for the addition operation of the WebAPP, the WebApp management platform is configured to perform the following:
[0019] persist the application code, the WebAPP, the actual access address proxy_pass, the certificate server.crt and the private key server.key of the WebAPP to the database, wherein the application code is not repeatable;
[0020] calculate the hash value of the application code as a prefix of the server_name through the backend service, and concatenate the hash value of the application code to the default domain name string provided by the WebAPP to form the server_name,
[0021] if the proxy_pass is an https service address, use the certificate and the private key of the WebAPP to be accessed or use the default certificate and the private key during login authentication, and finally persist the certificate and the private key to the specified directory of the Nginx proxy module server;
[0022] persist the application code uuid, the server_name, the certificate server_crt, the private key server_key, the deletion state is_deleted and the data update timestamp updated_time of the WebAPP to the web_app table of the database.
[0023] As a preferred, for the modification operation of the WebAPP, the WebApp management platform is used for modification based on the application code of the WebAPP, and the application code of the WebAPP is not modifiable;
[0024] if the WebApp management platform is accessed as a WebAPP, the WebApp management platform is not modifiable and deletable.
[0025] As a preferred, for the deletion operation of the WebAPP, the WebApp management platform is used for soft deleting the data corresponding to the WebAPP persisted in the database based on the application code, and the soft deletion method is: not directly deleting the data, modifying the is_deleted value of the data to true, and recording the modification time of the data.
[0026] As a preferred, for the query operation of the WebAPP, the WebApp management platform is used for querying the accessed WebAPP based on the WebAPP list, and reading and displaying the WebApp table data persisted in the database based on the server_name of the WebAPP.
[0027] As a preferred, the configuration refreshing module is used for performing the following operations:
[0028] Timing scan WebAPP table: get the last execution timestamp of the timing task from the cache, compare it with the modification time of the WebApp table data, when the modification time is later than the last execution timestamp of the timing task, perform incremental Nginx configuration update operation, if the timing task is the first execution, the last execution timestamp is empty, then perform full Nginx configuration update operation, according to the scanned data, execute the next step according to whether is_deleted is true or not;
[0029] When the data is_deleted value is false, it means that the configuration is added or modified, a configuration file with the file name #server_name# and the suffix conf is generated according to the template file conf.template, and the placeholders #server_name#, #proxy_pass#, #server.crt# and #server.key# are replaced with the actual values stored in the database, it is judged whether there is a same name file under the / etc / nginx / conf.d / directory, if there is no same name file under the directory, it means that the configuration is added, the generated file is directly copied to the / etc / nginx / conf.d / directory, if there is a same name file under the directory, it means that the configuration is updated, the same name file is deleted first and then the copy operation is performed; when the data state is soft deletion, it means that the configuration is deleted, the file with the file name #server_name# and the suffix conf under the / etc / nginx / conf.d / directory of the Nginx proxy module is deleted;
[0030] The nginx-s reload hot update command is executed to refresh the Nginx configuration and take effect immediately;
[0031] The soft deleted server_name information in the Nginx proxy configuration needs to be synchronized to clean the data in the WebApp table;
[0032] The timestamp of this timing task refresh is recorded in the cache for next execution.
[0033] The WebApp dynamic proxy system based on Nginx has the following advantages:
[0034] 1. The Nginx reverse proxy technology is used, combined with a visual operation interface, to realize dynamic proxy access to an uncertain number of business systems through a fixed IP and port that can be publicly accessed, greatly reducing the use and operation cost, and providing an efficient and flexible solution for business expansion and management in a cloud environment;
[0035] 2. Through a single public accessible IP address and port, proxy services for multiple WebApps are achieved. Users do not need to allocate independent IP and port for each WebApp, thereby simplifying the network architecture and reducing resource consumption;
[0036] 3. Through the WebApp management interface, the administrator can quickly generate a unique server_name for each business system, which will become part of the Nginx configuration, used to identify and proxy the corresponding business system. The function of quickly generating server_name greatly reduces the administrator's manual operation, improves work efficiency, and uses server_name as the key identifier to distinguish different WebApps, ensuring that requests can be accurately forwarded to the target business system;
[0037] 4. When a new business system needs to be accessed, the administrator only needs to add the corresponding WebApp, without manually modifying the Nginx configuration and restarting the Nginx service, and it can take effect immediately. Similarly, when a business system needs to exit, the administrator only needs to delete the corresponding WebApp from the WebApp management interface, and the configuration will be automatically updated, no longer proxying the business system. This quick access and exit mechanism enables the system to flexibly adapt to business changes, improving the scalability and flexibility of the system. BRIEF DESCRIPTION OF DRAWINGS
[0038] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained without creative labor based on these drawings.
[0039] The present application will be further described below in conjunction with the drawings.
[0040] Figure 1 A working block diagram of an embodiment of a WebApp dynamic proxy system based on Nginx;
[0041] Figure 2 A schematic diagram of Nginx default configuration in an embodiment of a WebApp dynamic proxy system based on Nginx;
[0042] Figure 3 A schematic diagram of WebApp access template in an embodiment of a WebApp dynamic proxy system based on Nginx;
[0043] Figure 4 A schematic diagram of WebApp table data example in an embodiment of a WebApp dynamic proxy system based on Nginx. DETAILED DESCRIPTION
[0044] The present application will be further described below in conjunction with the drawings and specific embodiments so that those skilled in the art can better understand the present application and implement it, but the embodiments are not intended to limit the present application, and the embodiments and technical features in the embodiments can be combined with each other without conflict.
[0045] The present application is a WebApp dynamic proxy system based on Nginx, which is used to realize proxy service for multiple business system WebAPP through an IP and a port. The system comprises an Nginx proxy module, a WebApp management platform, and a configuration refreshing module.
[0046] The Nginx proxy module is deployed on a server capable of public access, and is used to provide default configuration of the Nginx proxy and template configuration for WebAPP access.
[0047] The WebApp management platform interacts with administrators through a WebAPP management interface, and provides login authentication service and management operation of the WebAPP through the WebAPP management interface. The management operation of the WebAPP comprises access, exit, addition, modification, and deletion operation of the WebAPP, and is used to generate a unique identifier server_name for the accessed WebAPP, and form and display a WebAPP list and Web application of each WebAPP.
[0048] The configuration refreshing module is used to provide addition and deletion service of the Nginx proxy module configuration file and hot loading operation of the Ngeinx proxy application.
[0049] As a preferred, the Nginx proxy module installs or starts the Nginx service in the form of an rpm package or a docker image, and supports the http protocol.
[0050] As a preferred, the default configuration of the Nginx proxy comprises:
[0051] The Nginx default configuration file is modified, and all conf files in the directory / etc / nginx / conf.d / are referenced.
[0052] A unique port is set to be listened to, and a certificate needs to be set if the https port is listened to. The certificate can be configured as a self-signed certificate.
[0053] The server_name is limited to be not empty, and if it is empty, 403 Forbidden is returned.
[0054] Define server_name must exist, if the server_name does not exist, return 403 Forbidden.
[0055] As preferred, the Nginx proxy module supports the template configuration of the WebAPP, including:
[0056] Create a new template file conf.template, the content is the listening service for the unique port;
[0057] Set the server_name, certificate, private key, proxy_pass value of the WebAPP to the corresponding placeholders #server_name#, #server.crt#, #server.key#, #proxy_pass#.
[0058] As preferred, for the addition operation of the WebAPP, the WebApp management platform is used to execute as follows:
[0059] Persist the application code, WebAPP, actual access address proxy_pass, certificate server.crt and private key server.key of the WebAPP to the database, wherein the application code is not repeatable;
[0060] Calculate the hash value of the application code as the prefix of the server_name through the backend service, and concatenate the hash value of the application code with the default domain name string provided by the WebAPP to form the server_name,
[0061] If the proxy_pass is the https service address, use the certificate and private key of the WebApp to be accessed, or use the default certificate and private key during login authentication, and finally persist the certificate and private key to the specified directory of the Nginx proxy module server;
[0062] Persist the application code uuid, server_name, certificate server_crt, private key server_key, deletion state is_deleted and data update timestamp updated_time of the WebAPP to the web_app table of the database.
[0063] As preferred, for the modification operation of the WebAPP, the WebApp management platform is used to modify based on the application code of the WebAPP, and the application code of the WebAPP is not modifiable;
[0064] If the WebApp management platform is accessed as a WebAPP, the WebApp management platform is not modifiable and deletable.
[0065] As preferred, for the deletion operation of the WebAPP, the WebApp management platform is configured to soft delete the data corresponding to the WebAPP persisted in the database based on the application code, in the soft deletion manner of not directly deleting the data, modifying the is_deleted value of the data to true, and recording the modification time of the data.
[0066] As preferred, for the query operation of the WebAPP, the WebApp management platform is configured to query the accessed WebApp based on the WebAPP list, and read and display the WebApp table data persisted in the database based on the server_name of the WebAPP.
[0067] As preferred, the configuration refreshing module is configured to perform the following operations:
[0068] Timing scanning of the WebAPP table: obtaining the last execution timestamp of the timing task from the cache, comparing the modification time of the WebApp table data with the last execution timestamp of the timing task, when the modification time is later than the last execution timestamp of the timing task, performing the Nginx configuration update operation in an incremental manner, if the timing task is executed for the first time, the last execution timestamp is empty, then performing the Nginx configuration update operation in a full manner, according to the scanned data, whether the is_deleted value is true or not, performing the next step;
[0069] When the data is_deleted value is false, indicating that the configuration is added or modified, generating a configuration file with the file name #server_name# and the suffix conf according to the template file conf.template, and replacing the placeholders #server_name#, #proxy_pass#, #server.crt#, #server.key# with the actual values stored in the database, judging whether there is a same name file under the / etc / nginx / conf.d / directory, if there is no same name file under the directory, it is indicated that the configuration is added, and the generated file is directly copied to the / etc / nginx / conf.d / directory, if there is a same name file under the directory, it is indicated that the operation is an update operation, the same name file is deleted first and then the copying operation is performed; when the data state is soft deleted, it is indicated that the configuration is deleted, and the file with the file name #server_name# and the suffix conf under the / etc / nginx / conf.d / directory of the Nginx proxy module is deleted.
[0070] Performing the nginx-s reload hot update command to refresh the Nginx configuration and take effect immediately;
[0071] The soft-deleted server_name information in the Nginx proxy configuration has been cleaned up, and the data in the WebApp table needs to be cleaned up synchronously.
[0072] The timestamp of the current timing task refresh is recorded in the cache for next execution.
[0073] The embodiment of the application provides a WebApp dynamic proxy system based on Nginx, which is used to solve the technical problem of how to realize the proxy of multiple WebApps by a single IP and port based on the reverse proxy of Nginx, so as to reduce the use cost and operation and maintenance cost.
[0074] Embodiment 1:
[0075] The WebApp dynamic proxy system based on Nginx is used to realize the proxy service of multiple business system WebApps through an IP and a port, and the system comprises an Nginx proxy module, a WebApp management platform and a configuration refresh module.
[0076] The Nginx proxy module is deployed on a server capable of public access, and is used to provide the default configuration of the Nginx proxy and the template configuration of the WebAPP access.
[0077] In the embodiment, the Nginx service installed or started by using an rpm package, a docker image and the like is deployed on a server capable of public access, so as to ensure that the WebApp to be accessed subsequently is network-reachable. The Nginx proxy module is mainly aimed at seven-layer proxy (http protocol).
[0078] The default configuration of the Nginx proxy comprises:
[0079] (1) modifying the default configuration file of Nginx, and referring to all conf files in the directory / etc / nginx / conf.d / ;
[0080] (2) setting to listen to a unique port, and setting a certificate if listening to an https port, wherein the certificate can be configured as a self-signed certificate;
[0081] (3) limiting that the server_name cannot be empty, and returning 403 Forbidden if the server_name is empty;
[0082] (4) limiting that the server_name must exist, and returning 403 Forbidden if the server_name does not exist.
[0083] The specific configuration sample is shown in the following table. Figure 2
[0084] The Nginx proxy module of the embodiment provides a template configuration for WebApp access. The template configuration mainly includes:
[0085] (1) A template file conf.template is created, and the content is a server for listening to a unique port.
[0086] (2) The values of server_name, certificate, private key, and proxy_pass are set to corresponding placeholders #server_name#, #server.crt#, #server.key#, and #proxy_pass#.
[0087] The WebApp management platform interacts with administrators through a WebAPP management interface, provides login authentication services and management operations of WebAPP through the WebAPP management interface, and the management operations of WebAPP include access, exit, addition, modification, and deletion operations of WebAPP, and are used to generate a unique identifier server_name for the accessed WebAPP, and are used to form and display a WebAPP list and a Web application of each WebAPP.
[0088] In the embodiment, if public access is required, the WebApp management module and the Nginx proxy module are deployed on the same server, and the WebApp management module itself also serves as a WebApp. Administrators implement quick access and exit of WebApp through the WebApp management platform, so that the login authentication is passed before the WebApp can be used, and the WebApp should have high security.
[0089] The WebApp management platform provides a visual operation interface for access and exit of WebApp, and mainly provides addition, modification, deletion, and query operations for WebApp.
[0090] For the addition operation of WebAPP, the WebApp management platform is used to perform the following:
[0091] (1) The application code, WebAPP, actual access address proxy_pass, certificate server.crt, and private key server.key of the WebAPP are persisted to the database, and the application code is not repeated.
[0092] (2) The hash value of the application code is calculated as the prefix of server_name through a backend service, and the hash value of the application code is concatenated with the default domain name string provided by the WebAPP to form server_name.
[0093] (3) If the proxy_pass is the https service address, use the certificate and private key of the WebApp to be accessed, or use the default certificate and private key for login authentication, and finally persist the certificate and private key to the specified directory of the Nginx proxy module server;
[0094] (4) Persist the application code uuid, server_name, certificate server_crt, private key server_key, deletion state is_deleted, and data update timestamp updated_time of the WebAPP to the web_app table of the database.
[0095] For the modification operation of the WebAPP, the WebApp management platform is used to modify based on the application code of the WebAPP, and the application code of the WebAPP cannot be modified, and the rest can be modified. After modifying the data, the modification time of the data needs to be recorded. If the WebApp management platform is accessed as a WebAPP, the WebApp management platform cannot be modified and deleted.
[0096] For the deletion operation of the WebAPP, the WebApp management platform is used to soft delete the data corresponding to the WebAPP persisted in the database based on the application code. The soft deletion method is: do not directly delete the data, modify the is_deleted value of the data to true, and record the modification time of the data.
[0097] For the query operation of the WebAPP, the WebApp management platform is used to query the accessed WebAPP based on the WebAPP list, and read and display the WebApp table data persisted in the database based on the server_name of the WebAPP.
[0098] The WebApp management platform displays the WebApp table data condition query list, and the administrator can quickly review and modify the accessed WebApp through the list data, and provides the server_name of the specified WebApp to the user for use. If the server_name is not domain name resolved, the user can configure the local hosts file.
[0099] The configuration refresh module is used to provide the addition and deletion services of the Nginx proxy module configuration file and the hot loading operation of the Ngeinx proxy application.
[0100] The configuration refresh module is used to provide the addition and deletion services of the Nginx proxy module configuration file and the hot loading operation of the Ngeinx proxy application.
[0101] The refresh module in this embodiment provides functions such as timing scanning, Nginx configuration updating, Nginx hot loading, WebApp soft deletion data cleaning and the like. The specific operation is as follows:
[0102] The following operations are performed:
[0103] (1) Timing scanning of WebAPP table: The timestamp of the last execution of the timing task is obtained from the cache, and the modification time of the WebApp table data is compared. When the modification time is later than the timestamp of the last execution of the timing task, the Nginx configuration updating operation is incrementally executed. If the timing task is executed for the first time, the timestamp of the last execution is empty, and the Nginx configuration updating operation is executed in full. According to the scanned data, the next step is executed according to whether is_deleted is true or not;
[0104] (2) When the data is_deleted value is false, it indicates that the configuration is added or modified. The configuration file with the file name #server_name# and the suffix conf is generated according to the template file conf.template, and the placeholders #server_name#, #proxy_pass#, #server.crt# and #server.key# are replaced with the actual values stored in the database. It is judged whether there is a same name file under the / etc / nginx / conf.d / directory. If there is no same name file under the directory, it indicates that the configuration is added, and the generated file is directly copied to the / etc / nginx / conf.d / directory. If there is a same name file under the directory, it indicates that the operation is updated, and the same name file is deleted before the copying operation. When the data state is soft deletion, it indicates that the configuration is deleted, and the file with the file name #server_name# and the suffix conf under the / etc / nginx / conf.d / directory of the Nginx proxy module is deleted;
[0105] (3) The nginx-s reload hot update command is executed to refresh the Nginx configuration and take effect immediately;
[0106] (4) The soft deleted server_name information in the Nginx proxy configuration has been cleaned, and the data in the WebApp table needs to be cleaned synchronously;
[0107] (5) The timestamp of the current timing task refresh is recorded in the cache for next execution.
[0108] Based on the above operations (1)-(5), one configuration refresh operation is completed.
[0109] The system of the embodiment implements the proxy service for multiple WebApps through a single public accessible IP address and port. The user does not need to allocate independent IP and port for each WebApp, thereby simplifying the network architecture and reducing resource consumption.
[0110] The above has been described and illustrated in detail by the drawings and preferred embodiments, however the present application is not limited to these disclosed embodiments, and based on the above multiple embodiments, those skilled in the art can know that the means in the above different embodiments can be combined to obtain more embodiments of the present application, and these embodiments are also within the protection scope of the present application.
Claims
1. A WebApp dynamic proxy system based on Nginx, characterized in that, This is used to provide proxy services for multiple business WebApp systems through a single IP address and port. The system includes an Nginx proxy module, a WebApp management platform, and a configuration refresh module. The Nginx proxy module is deployed on a publicly accessible server and provides default Nginx proxy configuration and template configuration for WebAPP access. The default Nginx proxy configuration includes: modifying the default Nginx configuration file, referencing all conf files in the / etc / nginx / conf.d / directory; setting a unique listening port; if listening on an HTTPS port, a certificate must be configured, and the certificate is self-signed; restricting server_name from being empty (returning 403 Forbidden if empty); and requiring server_name to exist (returning 403 Forbidden if a non-existent server_name is encountered). The Nginx proxy module supports template configuration for WebAPP, including: creating a new template file conf.template, containing the listening service on the unique port; and setting the WebAPP's server_name, certificate, private key, and proxy_pass values to the corresponding placeholders #server_name#, #server.crt#, #server.key#, and #proxy_pass#. The WebApp management platform interacts with administrators through the WebApp management interface, which provides login authentication services and management operations for WebApps. These operations include accessing, logging out, adding, modifying, deleting, and querying WebApps. The platform generates a unique identifier, server_name, for each accessing WebApp and is used to create and display a list of WebApps and the web application for each WebApp. The configuration refresh module is used to provide services for adding and deleting Nginx proxy module configuration files, as well as hot reloading of Nginx proxy applications.
2. The Nginx-based WebApp dynamic proxy system according to claim 1, characterized in that, The Nginx proxy module can be installed or started as an Nginx service via RPM package or Docker image, and is designed for applications supporting the HTTP protocol.
3. The Nginx-based WebApp dynamic proxy system according to claim 1, characterized in that, For adding new operations to a WebApp, the WebApp management platform performs the following: The application code of the WebAPP, the WebAPP, the actual access address proxy_pass, the certificate server.crt, and the private key server.key are persisted to the database. The application code must be unique. The backend service calculates the hash value of the application code, which is used as the prefix of the server_name. The hash value of the application code is then concatenated with the default domain name string provided by the WebAPP to form the server_name. If proxy_pass is an HTTPS service address, the certificate and private key of the WebApp to be connected are used during login authentication, or the default certificate and private key are used. Finally, the certificate and private key are persisted to the specified directory of the Nginx proxy module server. The application code UUID, server_name, certificate server_crt, private key server_key, deletion status is_deleted, and data update timestamp updated_time of the WebAPP are persisted to the web_app table in the database.
4. The Nginx-based WebApp dynamic proxy system according to claim 3, characterized in that, Regarding modifications to the WebApp, the WebApp management platform is used to modify the WebApp's application code, and the WebApp's application code cannot be modified. If the WebApp management platform is accessed as a WebApp, the WebApp management platform cannot be modified or deleted.
5. The Nginx-based WebApp dynamic proxy system according to claim 3, characterized in that, For the deletion operation of WebAPP, the WebAPP management platform is used to soft delete the data persisted in the database corresponding to the WebAPP based on the application code. The soft deletion method is: do not directly delete the data, modify the is_deleted value of the data to true, and record the modification time of the data.
6. The Nginx-based WebApp dynamic proxy system according to claim 3, characterized in that, For WebApp query operations, the WebApp management platform is used to query the connected WebApps based on the WebApp list, and read and display the WebApp table data persisted in the database based on the WebApp's server_name.
7. The Nginx-based WebApp dynamic proxy system according to claim 3, characterized in that, The configuration refresh module is used to perform the following operations: Scheduled scanning of the WebApp table: Retrieve the timestamp of the last execution of the scheduled task from the cache and compare it with the modification time of the data in the WebApp table. If the modification time is later than the timestamp of the last execution of the scheduled task, perform incremental Nginx configuration update operations. If the scheduled task is being executed for the first time, the timestamp of the last execution is empty, so perform full Nginx configuration update operations. Based on the scanned data, proceed to the next step according to whether is_deleted is true. When the `is_deleted` value is false, it indicates a new or modified configuration. A configuration file named `#server_name#` with the `.conf` extension is generated based on the template file `conf.template`. The placeholders `#server_name#`, `#proxy_pass#`, `#server.crt#`, and `#server.key#` are replaced with the actual values stored in the database. It checks if a file with the same name exists in the ` / etc / nginx / conf.d / ` directory. If no file exists, it's a new configuration, and the generated file is directly copied to ` / etc / nginx / conf.d / `. If a file exists, it's an update operation, and the file is deleted before copying. When the status is a soft delete, it indicates a configuration deletion. The file named `#server_name#` with the `.conf` extension in the ` / etc / nginx / conf.d / ` directory on the server where the Nginx proxy module is located is deleted. Execute the `nginx -s reload` hot reload command to refresh the Nginx configuration and make it take effect immediately; The server_name information in the Nginx proxy configuration has been deleted softly, and the data in the WebApp table needs to be deleted synchronously. The timestamp of this scheduled task refresh is recorded in the cache for use in the next execution.
Citation Information
Patent Citations
Information management system and method
CN110784527A
Access processing method and device
CN117014531A