Automatic reverse proxy method and system for accessing extranet by intranet server

Through the automated reverse proxy method, users can simply configure the intranet server to access external network resources through external network proxy, solving the complexity and error risks of traditional manual configuration and achieving efficient and automated network access.

CN119676298AInactive Publication Date: 2025-03-21POWERLEADER COMPUTER SYST CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202510184695.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-19
Publication Date
2025-03-21
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Traditional reverse proxy service deployment requires complex manual configuration, which increases operation and maintenance costs, is prone to configuration errors, and lacks extensive adaptability and automation support.

Method used

It provides an automated reverse proxy method for intranet servers to access external networks. By inputting external network server information, automatically detecting the operating system, selecting suitable proxy services (such as Squid or Nginx), and remotely installing and configuring proxy services, outputting the IP address and port information of the external network proxy server, setting the proxy configuration of the intranet machine, and verifying whether the proxy settings are successful.

Benefits of technology

It simplifies the installation and configuration process of reverse proxy servers, reduces the risk of configuration errors, reduces the burden on operation and maintenance personnel, supports multi-platform compatibility, eliminates the need for additional hardware equipment, reduces deployment costs, and improves work efficiency and network service stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119676298A_ABST
    Figure CN119676298A_ABST
Patent Text Reader

Abstract

The invention relates to an automatic reverse proxy method and system for accessing an extranet by an intranet server. The method comprises the following steps: inputting extranet server information by a user to enable a script to perform remote operation through SSH connection; selecting a proxy service type through a user; automatically detecting the operating system so as to select a suitable package management tool according to the difference of the operating system; according to the selected proxy service type, remotely installing and configuring a proxy service on an external network server; outputting the IP address and the port information of the external network proxy server for subsequent configuration of a user; setting proxy configuration of an intranet machine so as to access an external network through an extranet proxy; verifying whether the proxy setting is successful; and if yes, outputting agent configuration success, otherwise, outputting error prompt information. According to the method, automatic configuration is realized, parts can be effectively saved, the configuration accuracy is improved, the operation and maintenance burden is reduced, efficient expansion is realized, dynamic requirements can be met, and sustainable maintenance and management are realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to an automatic reverse proxy method and system for an intranet server to access an external network, belonging to the field of network communication. Background Art

[0002] With the rapid development of information technology, more and more enterprises, scientific research institutions, laboratories and other units have adopted the security strategy of isolating the intranet from the extranet to protect the internal network from external threats. However, in fact, in the intranet environment, servers still often need to access external resources, such as software updates, external APIs, online services, etc. Therefore, if there is no direct access to the extranet, the intranet server needs to connect to the extranet in some way. In actual applications, many intranets usually need to rely on proxy servers or VPN technologies to achieve extranet access.

[0003] At present, proxy servers are the way to access the external network adopted by most intranets. They set up proxy services on the external network servers to forward the requests of the internal network servers to the external network, thereby achieving external access. As a network intermediary, the proxy server can provide the ability for the internal network server to access the external network, and effectively control the access traffic to ensure security. In particular, reverse proxy services (such as Squid, Nginx, etc.) can not only help the servers in the internal network environment communicate with the external network, but also optimize bandwidth, reduce latency, and protect the security of the internal network. Among them, Squid, as the most widely used proxy server, is suitable for high-concurrency scenarios; Nginx is mainly used for Web servers and is also suitable for large-scale reverse proxy deployment.

[0004] However, the deployment of reverse proxy services in traditional solutions usually requires complex manual configuration, requiring operation and maintenance personnel to have strong technical capabilities. Especially in complex environments such as customer sites and laboratories, operation and maintenance personnel are often required to manually install proxy services, edit configuration files, and set access rules according to the operating system version and network environment. It is also necessary to consider factors such as operating system version, software dependency, and network environment. Especially when switching between multiple operating systems (such as Ubuntu, CentOS) and multiple proxy services (such as Squid, Nginx), operation and maintenance personnel need to master the detailed configuration steps of the proxy service and adjust the configuration according to different network environments. The configuration is difficult. The above traditional manual configuration not only increases the operation and maintenance costs, but also is prone to errors or omissions due to complex configuration and cumbersome steps, which not only reduces work efficiency, but also incorrect configuration may lead to inability to access the external network normally, and even cause network security problems. In addition, this traditional reverse proxy deployment solution is usually targeted at a specific operating system or platform, lacks wide adaptability, lacks sufficient automation support, and usually requires manual modification of multiple configuration files or execution of multiple commands. Even if there are script automation tools, complex configuration and adjustment are required, which is easily affected by human factors. In addition, commercial proxy services require additional hardware equipment or cloud services and usually charge higher fees, which will also increase user costs. Summary of the invention

[0005] The present invention provides an automated reverse proxy method and system for an intranet server to access an external network, aiming to solve at least one of the technical problems existing in the prior art.

[0006] The technical solution of the present invention relates to an automated reverse proxy method for an intranet server to access an extranet. The method according to the present invention comprises the following steps:

[0007] S100, the user inputs the external network server information so that the script can be remotely operated through the SSH connection;

[0008] S200, selecting the proxy service type by the user;

[0009] S300, automatically detecting the operating system to select a suitable package management tool according to different operating systems;

[0010] S400, remotely installing and configuring the proxy service on the external network server according to the selected proxy service type;

[0011] S500, output the IP address and port information of the external network proxy server for subsequent configuration by the user;

[0012] S600, setting the proxy configuration of the intranet machine to access the external network through the external network proxy;

[0013] S700, verify whether the proxy setting is successful; if so, output the proxy configuration success, otherwise output an error prompt message.

[0014] Furthermore, in step 100, the external network server information includes IP, user name and password.

[0015] Furthermore, in step 100, the input password is hidden by the -s option.

[0016] Furthermore, in step S200, the proxy service options are outputted via echo, so that the user can select the corresponding service by inputting 1 or 2.

[0017] Furthermore, in step S300, the cat / etc / *release command is used to check the operating system distribution version, and apt or yum is set according to the result.

[0018] Further, the step S400 includes:

[0019] S410, when the proxy service type selected by the user is Squid, the installation command is executed through SSH to install Squid, and the proxy port and access control are set through the configuration file;

[0020] S420, when the user selects Nginx as the proxy service type, install and configure Nginx as a reverse proxy service and modify the target website or IP address in the Nginx configuration file according to actual needs.

[0021] Furthermore, in step S600, the script sets proxy environment variables for HTTP and HTTPS, and writes the configuration into the ~ / .bashrc file to make the configuration persistent.

[0022] Furthermore, in step S600, apt or yum is configured to use a proxy according to the system's package management tool.

[0023] The technical solution of the present invention also relates to a computer-readable storage medium on which program instructions are stored, and the above-mentioned method is implemented when the program instructions are executed by a processor.

[0024] The technical solution of the present invention also relates to an automated reverse proxy system for an intranet server to access an external network, wherein the system comprises a computer device, and the computer device comprises the above-mentioned computer-readable storage medium.

[0025] The beneficial effects of the present invention are as follows:

[0026] The goal of the present invention is to provide a simple, efficient and automated solution for all users who need to access the extranet in an intranet environment, which is not only suitable for operation and maintenance personnel, but also can provide a convenient network configuration tool for developers, testers, scientific researchers, etc. Through the automated deployment of reverse proxy services, users only need to perform simple configuration to enable the intranet server to access extranet resources through the extranet proxy, thus solving the network access problem caused by the isolation of the intranet environment and the extranet.

[0027] The present invention can simplify the installation and configuration process of the reverse proxy server by means of scripting and automation, so that the operation and maintenance personnel no longer need to master the complex proxy configuration technology in depth. The user only needs to provide the basic information of the external network server (such as IP address, user name, password, etc.), and the appropriate proxy service (such as Squid or Nginx) can be automatically selected and configured, so that even the operation and maintenance personnel with low technical level can complete the deployment of the reverse proxy by simply inputting commands or parameters. This not only reduces the complexity of manual operation, but also reduces the risk of configuration errors, lowers the technical threshold of configuration, and reduces human operation errors.

[0028] The automated deployment solution of the present invention can completely replace the manual operation in the traditional solution, avoiding configuration errors caused by human factors. All configurations (such as proxy service installation, proxy port setting, proxy rule configuration) are automatically completed by the script, reducing manual intervention and improving work efficiency.

[0029] The present invention can automatically detect the current operating system type (such as Debian, CentOS, etc.), and automatically select the appropriate installation method and configuration file format according to different operating systems. This means that no matter what kind of intranet environment, users can quickly adapt and deploy without manually adjusting settings.

[0030] The present invention does not need to rely on additional hardware devices or services, and completely implements the configuration of reverse proxy through software and scripts. Compared with traditional VPN solutions and commercial proxy services, the present invention can meet the needs of intranet access to the extranet without increasing additional hardware costs, reducing deployment costs and having strong practicality and market application prospects. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] Figure 1 is a basic flow chart of the method according to the present invention. DETAILED DESCRIPTION

[0032] The concept, specific structure and technical effects of the present invention will be clearly and completely described below in combination with the embodiments and drawings to fully understand the purpose, scheme and effect of the present invention.

[0033] It should be noted that, unless otherwise specified, when a feature is referred to as being "fixed" or "connected" to another feature, it may be directly fixed or connected to another feature, or it may be indirectly fixed or connected to another feature. The singular forms "a", "said" and "the" used herein are also intended to include the plural forms, unless the context clearly indicates otherwise. In addition, unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art. The terms used in this specification are intended only to describe specific embodiments and are not intended to limit the invention. The term "and / or" used herein includes any combination of one or more of the related listed items.

[0034] It should be understood that, although the term first, second, third etc. may be adopted to describe various elements in the present disclosure, these elements should not be limited to these terms. These terms are only used to distinguish the same type of elements from each other. For example, without departing from the scope of the present disclosure, the first element may also be referred to as the second element, and similarly, the second element may also be referred to as the first element. The use of any and all examples or exemplary language ("for example", "such as" etc.) provided herein is only intended to better illustrate embodiments of the present invention, and unless otherwise required, will not impose limitations on the scope of the present invention.

[0035] Reference Figure 1 In some embodiments, the automated reverse proxy method for an intranet server to access an external network according to the present invention comprises at least the following steps:

[0036] S100, the user inputs the external network server information so that the script can be remotely operated through the SSH connection;

[0037] S200, selecting the proxy service type by the user;

[0038] S300, automatically detecting the operating system to select a suitable package management tool according to different operating systems;

[0039] S400, remotely installing and configuring the proxy service on the external network server according to the selected proxy service type;

[0040] S500, output the IP address and port information of the external network proxy server for subsequent configuration by the user;

[0041] S600, setting the proxy configuration of the intranet machine to access the external network through the external network proxy;

[0042] S700, verify whether the proxy setting is successful; if so, output the proxy configuration success, otherwise output an error prompt message.

[0043] Compared with the prior art, the more efficient, more accurate and more scalable automated reverse proxy deployment method of the present invention solves the time, accuracy, scalability and maintainability problems caused by manual configuration in the prior art through automated configuration, which not only improves work efficiency and reduces the burden on operation and maintenance personnel, but also supports larger-scale system deployment and management, and is particularly suitable for scenarios that change rapidly or require efficient deployment, such as customer sites or laboratory intranet environments.

[0044] Specifically, the present invention simplifies the configuration process of the reverse proxy service by providing a one-click automated deployment solution, enabling users to select appropriate proxy services under different operating systems and automatically complete the deployment, thereby avoiding the complexity of manual configuration and the risk of configuration errors. The present invention is not limited to operation and maintenance personnel. Any user who needs to access the extranet under an intranet environment (such as developers, testers, researchers, etc.) can conveniently allow the intranet server to access the extranet through the extranet proxy server, greatly improving the convenience of these users in network access, reducing the difficulty of configuration and operation and maintenance, improving work efficiency, reducing the need for human intervention, and greatly reducing the risk of configuration errors, thereby improving the stability and reliability of network services. The present invention can automatically identify different operating systems (such as Ubuntu, Debian, CentOS, RedHat, etc.), and automatically select the corresponding proxy service installation and configuration method according to the operating system type, ensuring that the reverse proxy server can be smoothly deployed regardless of the operating system environment, thereby solving the problem of multi-platform compatibility.

[0045] In some embodiments, the present invention obtains basic information of the external network server through the user inputting the external network server information such as IP, username and password, and ensures that the script can be remotely operated through the SSH connection. At this stage, the script first obtains the necessary information of the external network proxy server, such as IP address, username and password. This information is the basis for subsequent connection to the external proxy server to ensure correct identity authentication and connection settings. After the user enters this information, the script will save it and use it to configure the proxy connection.

[0046] Specifically, the read command prompts the user to enter the IP address, username, and password of the external server. Furthermore, the password input can be hidden through the -s option to protect user privacy. The specific settings are as follows:

[0047] read -p "Please enter the IP address of the external server: " EXTERNAL_SERVER_IP

[0048] read -p "Please enter the username of the external server: " EXTERNAL_SERVER_USER

[0049] read -sp "Please enter the password of the external server: " EXTERNAL_SERVER_PASSWORD

[0050] In some embodiments, the present invention determines the type of proxy service to be installed through user selection. Among them, Squid and Nginx are two common proxy services, and the user selects according to needs. The user selects the proxy service type (such as Squid or Nginx), which customizes the configuration scheme according to different proxy requirements. This step simplifies the selection process, and the user does not need to manually install and configure each service type. The script will automatically configure the corresponding proxy service according to the user's selection, and subsequently perform the corresponding installation and configuration operations.

[0051] Specifically, the proxy service options are output through echo, and the user selects the corresponding service by inputting 1 or 2. Further, the options can be expanded to support more types of proxy services. The specific settings are as follows:

[0052] echo "Please select the proxy service type:"

[0053] echo "1. Squid"

[0054] echo "2. Nginx"

[0055] read -p "Please enter the proxy service you choose (1 or 2): " PROXY_TYPE

[0056] In some embodiments, the present invention automatically detects the operating system (APT or YUM) and selects a suitable package management tool according to the different operating systems. Among them, the Linux system uses apt (such as Ubuntu, Debian) or yum (such as CentOS, RedHat). The script selects the appropriate package management tool (APT or YUM) by automatically detecting the operating system type. This operation avoids the user manually specifying the operating system, so that the script can be universal on different Linux distributions. In this way, the script can automatically select the path of the installation command and configuration file according to the system environment to ensure that the proxy service can be successfully installed and configured.

[0057] Specifically, use the cat / etc / *release command to check the operating system distribution, and set apt or yum according to the result. It can be understood that the above steps ensure that the script can adapt to different Linux distributions. The specific settings are as follows:

[0058] OS_DISTRO=$(cat / etc / *release | grep -i "ubuntu\|debian" > / dev / null&& echo "apt" || echo "yum")

[0059] In some embodiments, the present invention remotely installs and configures the corresponding proxy service on the external network server according to the proxy service type selected by the user. Specifically, according to the proxy type selected by the user, the script will automatically install the corresponding proxy service (such as Squid or Nginx). After the installation is complete, the script will modify the configuration file of the proxy service so that it can work normally. The proxy service is configured to accept the request of the client and forward it to the external network resource. The configuration file usually includes the proxy port, access control rules and other contents, thereby ensuring the security and effectiveness of the proxy service.

[0060] For example, if the user selects Squid as the proxy service type, execute the installation command through SSH to install Squid, and set the proxy port, access control, etc. through the configuration file; if the user selects Nginx as the proxy service type, install and configure Nginx as a reverse proxy service, and modify the target website or IP address in the Nginx configuration file according to actual needs.

[0061] The specific settings are as follows:

[0062] if [[ "$PROXY_TYPE" -eq 1 ]]; then

[0063] sshpass -p "$EXTERNAL_SERVER_PASSWORD" ssh -oStrictHostKeyChecking=no $EXTERNAL_SERVER_USER@$EXTERNAL_SERVER_IP < <EOF

[0064] # Install Squid

[0065] if [[ "$OS_DISTRO" == "apt" ]]; then

[0066] sudo apt update -y

[0067] sudo apt install -y squid

[0068] else

[0069] sudo yum install -y squid

[0070] fi

[0071] # Configure Squid

[0072] sudo bash -c 'cat > / etc / squid / squid.conf <<EOL

[0073] http_port $PROXY_PORT

[0074] acl localnet src 10.0.0.0 / 8 192.168.0.0 / 16 172.16.0.0 / 12

[0075] http_access allow localnet

[0076] http_access deny all

[0077] EOL'

[0078] sudo systemctl restart squid

[0079] EOF

[0080] elif [[ "$PROXY_TYPE" -eq 2 ]]; then

[0081] sshpass -p "$EXTERNAL_SERVER_PASSWORD" ssh -oStrictHostKeyChecking=no $EXTERNAL_SERVER_USER@$EXTERNAL_SERVER_IP <<EOF

[0082] # Install Nginx

[0083] if [[ "$OS_DISTRO" == "apt" ]]; then

[0084] sudo apt update -y

[0085] sudo apt install -y nginx

[0086] else

[0087] sudo yum install -y nginx

[0088] fi

[0089] #Configure Nginx reverse proxy

[0090] sudo bash -c 'cat > / etc / nginx / sites-available / default < <EOL

[0091] server {

[0092] listen $PROXY_PORT;

[0093] location / {

[0094] proxy_pass http: / / example.com;

[0095] proxy_set_header Host \$host;

[0096] proxy_set_header X-Real-IP \$remote_addr;

[0097] proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for;

[0098] proxy_set_header X-Forwarded-Proto \$scheme;

[0099] }

[0100] }

[0101] EOL'

[0102] sudo systemctl restart nginx

[0103] EOF

[0104] In some embodiments, the present invention obtains the public IP address of the external network server through curl, and outputs the IP address and port information of the external network proxy server for subsequent configuration by the user. By accessing the external network, the script will obtain the public IP address of the external network proxy server and the corresponding proxy port. It is understandable that this information is crucial to the user because it identifies the address and port number of the proxy server and is the key for the client to access. At this point, the proxy server has been configured and is in an available state. The script confirms that the proxy server is ready by obtaining and displaying the external network proxy information.

[0105] Specifically, the script obtains the external IP address through the curl command and outputs the complete proxy address. The specific settings are as follows:

[0106] EXTERNAL_IP=$(curl -s ifconfig.me)

[0107] echo "The external proxy server has been successfully deployed!"

[0108] echo "Proxy server address: http: / / $EXTERNAL_IP:$PROXY_PORT"

[0109] In some embodiments, the present invention sets the proxy configuration of the intranet machine to ensure access to the external network through the external network proxy. The script modifies the environment variables of the local machine (such as http_proxy and https_proxy) to point all network requests of the local machine to the external network proxy server. In this way, all HTTP and HTTPS requests will be forwarded through the proxy. In addition, the script will also modify the configuration file of the package management tool (APT or YUM) to ensure that even when performing operations such as software installation or update in the command line, it can still connect through the proxy server.

[0110] Specifically, the script sets the proxy environment variables for HTTP and HTTPS, and writes the configuration to the ~ / .bashrc file to make it persistent. Furthermore, it configures apt or yum to use the proxy according to the system's package management tool. The specific settings are as follows:

[0111] read -p "Please enter the address of the external proxy server (usually $EXTERNAL_SERVER_IP):"

[0112] echo "Configuring this machine's proxy settings..."

[0113] # Set HTTP and HTTPS proxy environment variables

[0114] export http_proxy="http: / / $PROXY_SERVER_IP:$PROXY_PORT"

[0115] export https_proxy="http: / / $PROXY_SERVER_IP:$PROXY_PORT"

[0116] # Write the configuration to the bashrc file for configuration persistence

[0117] echo "export http_proxy=\"http: / / $PROXY_SERVER_IP:$PROXY_PORT\"" >>~ / .bashrc

[0118] echo "export https_proxy=\"http: / / $PROXY_SERVER_IP:$PROXY_PORT\"" >>~ / .bashrc

[0119] # Configure apt or yum to use a proxy (depending on the system package management tool)

[0120] if [[ "$OS_DISTRO" == "apt" ]]; then

[0121] echo "Acquire::http::Proxy \"http: / / $PROXY_SERVER_IP:$PROXY_PORT\";" | sudo tee / etc / apt / apt.conf.d / 95proxy

[0122] else

[0123] echo "proxy=http: / / $PROXY_SERVER_IP:$PROXY_PORT" | sudo tee / etc / yum.conf

[0124] fi

[0125] In some embodiments, the present invention verifies whether the proxy configuration is correct to successfully access the external network through the proxy. The script verifies whether the proxy settings are effective by executing a simple network request (such as curl). This step checks whether the external network (for example, accessing websites such as Google) can be successfully connected through the proxy server. If it can respond smoothly, it means that the proxy configuration is successful. All network requests of this machine (including browsers, package management tools, etc.) can access external Internet resources through the proxy server. This test link ensures that all configurations are correct and the user's device can now access the external network through the proxy.

[0126] Specifically, the script uses the curl command to test external network access. If successful, it outputs that the proxy configuration is successful; otherwise, it outputs an error message. The specific settings are as follows:

[0127] echo "Testing proxy configuration..."

[0128] curl -I https: / / www.baidu.com

[0129] if [ $? -eq 0 ]; then

[0130] echo "Proxy configuration is successful. You can now access the external network through the proxy server!"

[0131] else

[0132] echo "Proxy configuration failed, please check the external proxy server and network settings."

[0133] fi

[0134] The present invention uses the above steps to enable the proxy server to build a connection bridge between the outside and the local machine. Specifically, first, the external network proxy server is correctly installed and configured, and can accept requests from the local machine. Secondly, the local machine directs all HTTP and HTTPS requests to the proxy server through environment variables, so that it can bypass local network restrictions or firewalls and successfully connect to external Internet resources. Through these automated settings, users can directly achieve the purpose of accessing the external network without manually configuring the proxy server. It should be noted that the external network server can access external network resources, and the firewall of the external network server needs to be closed so that the internal network server request can reach the external network server.

[0135] Here, some specific examples are used to illustrate and verify, and the specific data comparison table below is available:

[0136] The manual configuration instance A settings are: operating system: Ubuntu 20.04; external network proxy: Squid proxy; configuration steps: manually connect to the external network server, install Squid, configure the Squid configuration file, manually modify the internal network proxy setting file, etc.; error rate: during the configuration process of each internal network server, 10% of the configuration errors occurred, which required manual debugging, resulting in longer deployment time.

[0137] The settings for automated configuration instance B are: operating system: Ubuntu 20.04; external network proxy: Squid proxy; configuration steps: automatically connect to the external network server, install Squid, configure proxy settings, and automatically modify the internal network server configuration through the script; error rate: the script is automatically executed without manual intervention, and the success rate is 100%.

[0138] Specific data comparison table

[0139] index Manual configuration (Instance A) Automatic configuration (Instance B) difference Configuration time (minutes) 1 hour (60 minutes) 15 mins Save 45 minutes Configuration success rate 90% (10% errors occur and require manual debugging) 100% (automatic configuration, 100% success rate) Increase by 10% Operational complexity High (manual installation, configuration, and debugging required) Low (run the script and complete the configuration automatically) Simplified operation Number of servers (supported) Each server needs to be configured separately One configuration can support batch deployment of multiple servers Supports large-scale expansion Configuration consistency Configuration may be missing or inconsistent Completely consistent configuration to ensure uniformity Maintaining Configuration Consistency

[0140] Compared with the traditional reverse proxy configuration method which usually relies on manual operation, especially in large-scale deployment, each server needs to be configured independently, which is time-consuming and prone to human errors, and manual configuration lacks flexibility. Whenever a new device needs to be configured, it must start from scratch, which makes it difficult to quickly adapt to large-scale and dynamically changing environments. The present invention realizes automated configuration, which can effectively save parts, improve configuration accuracy, reduce operation and maintenance burden, achieve efficient expansion and adapt to dynamic needs, and sustainable maintenance management.

[0141] Among them, the present invention completes the reverse proxy configuration through an automated script, which greatly reduces the configuration time. For example, by deploying the reverse proxy with a one-click script, the intranet server can quickly establish a proxy connection with the external network server, avoiding the repeated steps and complex operations that may occur during the manual configuration process. Compared with traditional manual configuration, the automated method of the present invention can complete the configuration within 15 minutes, while the manual method usually takes about 1 hour, which greatly improves work efficiency.

[0142] The automated script of the present invention eliminates errors caused by human operation and ensures that the configuration of each server is consistent. Compared with traditional manual configuration, the operation and maintenance personnel may miss or make configuration errors due to fatigue or negligence, which increases the workload of subsequent investigation and repair. The automated script used in the present invention can be executed accurately according to the set steps during execution, ensuring that each step can be accurately executed, thereby greatly reducing the possibility of configuration errors and ensuring the high availability and stability of the proxy server.

[0143] The present invention simplifies the workflow of operation and maintenance personnel through automated configuration. Traditional reverse proxy configuration requires manual operation by operation and maintenance personnel, which is a heavy workload, especially in an environment with multiple devices. However, the present invention can batch deploy reverse proxy settings through simple scripts, quickly respond to customer needs, and significantly reduce the demand for human resources.

[0144] The present invention supports large-scale automated configuration and expansion. In manual configuration, each newly added device needs to be manually configured, and the configuration process is cumbersome. With automated scripts, users only need to configure once to batch deploy on multiple servers, supporting flexible expansion. This makes the present invention more adaptable in high-demand and dynamically changing environments.

[0145] During the configuration process, the automated script of the present invention can automatically select appropriate installation and configuration steps according to the system environment (such as operating system type, package management tool, etc.), ensuring the uniformity and maintainability of the configuration. In manual configuration, especially across different operating systems or versions, inconsistent configurations often occur, increasing the complexity of later maintenance. Automated configuration not only improves the maintainability of the system, but also reduces operation and maintenance problems caused by version updates or system upgrades.

[0146] The existing way of accessing the external network through source code files such as Nginx, OpenSSL, zlib, PCRE and the compilation and configuration of module resource codes such as Nginx-stick is relatively complex and cumbersome, and module code compilation is prone to errors. The implementation of the method of the present invention is relatively simple and can be fully automated, and the proxy can be completed by simply interacting with the customer to confirm the information.

[0147] It should be appreciated that the method steps in the embodiments of the present invention can be implemented or implemented by computer hardware, a combination of hardware and software, or by computer instructions stored in a non-transitory computer readable memory. The method can use standard programming techniques. Each program can be implemented in a high-level process or object-oriented programming language to communicate with a computer system. However, if necessary, the program can be implemented in an assembly or machine language. In any case, the language can be a compiled or interpreted language. In addition, the program can be run on a programmed ASIC for this purpose.

[0148] In addition, the operations of the processes described herein may be performed in any suitable order unless otherwise indicated herein or otherwise clearly contradicted by context. The processes described herein (or variations and / or combinations thereof) may be performed under the control of one or more computer systems configured with executable instructions, and may be implemented as code (e.g., executable instructions, one or more computer programs, or one or more applications) that is executed collectively on one or more processors, by hardware, or a combination thereof. The computer program includes a plurality of instructions that may be executed by one or more processors.

[0149] Further, the method can be implemented in any type of computing platform that is operably connected to a suitable computer, including but not limited to a personal computer, a minicomputer, a mainframe, a workstation, a network or distributed computing environment, a separate or integrated computer platform, or in communication with a charged particle tool or other imaging device, etc. Various aspects of the present invention can be implemented in machine-readable code stored on a non-transitory storage medium or device, whether removable or integrated into a computing platform, such as a hard disk, an optical read and / or write storage medium, an RSM, a ROM, etc., so that it can be read by a programmable computer, and when the storage medium or device is read by the computer, it can be used to configure and operate the computer to perform the process described herein. In addition, the machine-readable code, or portions thereof, can be transmitted via a wired or wireless network. When such media includes instructions or programs that implement the steps described above in conjunction with a microprocessor or other data processor, the invention described herein includes these and other different types of non-transitory computer-readable storage media. When programmed according to the methods and techniques of the present invention, the present invention can also include the computer itself.

[0150] The computer program can be applied to input data to perform the functions described herein, thereby converting the input data to generate output data stored in a non-volatile memory. The output information can also be applied to one or more output devices such as a display. In a preferred embodiment of the present invention, the converted data represents physical and tangible objects, including specific visual depictions of physical and tangible objects produced on the display.

[0151] The above is only a preferred embodiment of the present invention. The present invention is not limited to the above implementation. As long as the technical effect of the present invention is achieved by the same means, any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the scope of protection of the present invention. Within the scope of protection of the present invention, its technical scheme and / or implementation method may have various modifications and changes.

Claims

1. An automated reverse proxy method for an intranet server to access an external network, characterized in that: The method comprises the following steps: S100, the user inputs the external network server information so that the script can be remotely operated through the SSH connection; S200, selecting the proxy service type by the user; S300, automatically detecting the operating system to select a suitable package management tool according to different operating systems; S400, remotely installing and configuring the proxy service on the external network server according to the selected proxy service type; S500, output the IP address and port information of the external network proxy server for subsequent configuration by the user; S600, setting the proxy configuration of the intranet machine to access the external network through the external network proxy; S700, verify whether the proxy setting is successful; if so, output the proxy configuration success, otherwise output an error prompt message.

2. The method according to claim 1, characterized in that In step 100, the external network server information includes IP, user name and password.

3. The method according to claim 2, characterized in that In step 100, the input password is hidden by the -s option.

4. The method according to claim 1, characterized in that: In step S200, the proxy service options are outputted through echo, so that the user can select the corresponding service by inputting 1 or 2.

5. The method according to claim 1, characterized in that In step S300, the cat / etc / *release command is used to check the operating system distribution version, and apt or yum is set according to the result.

6. The method according to claim 1, characterized in that The step S400 includes: S410, when the proxy service type selected by the user is Squid, the installation command is executed through SSH to install Squid, and the proxy port and access control are set through the configuration file; S420, when the user selects Nginx as the proxy service type, install and configure Nginx as a reverse proxy service and modify the target website or IP address in the Nginx configuration file according to actual needs.

7. The method according to claim 1, characterized in that In step S600, the script sets the proxy environment variables of HTTP and HTTPS, and writes the configuration into the ~ / .bashrc file to make the configuration persistent.

8. The method according to claim 1, characterized in that In step S600, apt or yum is configured to use a proxy according to the system's package management tool.

9. A computer-readable storage medium having program instructions stored thereon, characterized in that: When the program instructions are executed by a processor, the method according to any one of claims 1 to 8 is implemented.

10. An automated reverse proxy system for intranet servers to access the external network, characterized in that: include: A computer device comprising a computer readable storage medium according to claim 9.

Citation Information

Patent Citations

  • Method for automatically deploying software agent end for Linux system

    CN111209012A

  • Micro-service application cross-network communication method, device, system and equipment

    CN113301116A

  • Method for integrating Web system based on reverse proxy

    CN117319480A

  • System and method for targeted endpoint data acquisition

    US20210099528A1