A method and system for intranet accessing the Internet
By configuring reverse proxy and self-developed middleware on external servers and middleware servers, multi-layer verification and forwarding are solved, and the problem of difficulty in judging the reasons for access failure in Chinese and foreign networks in the existing technology is improved, and user interaction and access security are improved. , realizes fast and secure intranet Internet access.
Patent Information
- Application Number
- CN202211030956.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-26
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2042-08-26
AI Technical Summary
The lack of verification of multi-layer reverse proxy in the prior art has led to the inability to judge the reasons for the failure of external network access, resulting in poor user interaction.
By configuring a reverse proxy web server and a self-developed middleware server on an external server, multi-layer reverse proxy authentication is realized, including identity authentication and secondary verification, using the enterprise WeChat interface for user information verification, and accurately configured through nginx Expressions are forwarded and matched.
It improves the interactivity of the entire process, realizes the legality verification of user information, ensures the fast and security of Internet access to the internal business system, and realizes single sign-in, without affecting the access of the business system.
Smart Images

Figure CN115459970B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of network security, and in particular, relates to a method and system for an intranet to access the Internet. Background Art
[0002] Due to the rapid development of the Internet, network security has become increasingly important. Many large, medium and small companies have become more strict with server management. The server not only turns on the system firewall but also establishes a physical firewall. This does provide a certain degree of security, but it also creates certain obstacles for the system to access the Internet.
[0003] In the Chinese invention patent with patent number CN202010786330.3, a method for intranet terminal to access the Internet is disclosed, including: the client completes the request authentication to the server and establishes a connection with the remote application; the client receives the image data of the virtual interface of the remote application sent by the server, and displays the virtual interface of the remote application according to the image data of the virtual interface, and the virtual interface includes shortcut icons of multiple types of browsers; the client obtains the user's mouse click / keyboard input operation instructions for the displayed virtual interface, and sends the operation instructions to the server; the client receives the image data of the updated virtual interface returned by the server in response to the operation instruction, and updates the virtual interface of the remote application in real time according to the image data of the updated virtual interface, and the operation instruction is that the user remotely operates a certain browser to access the Internet; the client continuously obtains the mouse click / keyboard input operation instructions of the user and sends them to the server until the access to the Internet is completed; the client cancels the authentication and disconnects the remote application. It is realized that while the intranet terminal can safely access the internal network, it can also safely access the Internet.
[0004] The defect in the existing patent is that although the existing patent realizes the security of intranet access to the external network, it lacks multi-layer reverse proxy verification and cannot determine the reason for the failure of its external network access, resulting in poor user interactivity. Summary of the invention
[0005] In view of the problem that the prior art lacks multi-layer reverse proxy verification and cannot determine the cause of failure in external network access, resulting in poor user interactivity, the present invention provides a method and system for intranet access to the Internet.
[0006] In order to achieve the above technical objectives, the technical solution adopted by the present invention is as follows:
[0007] A method for accessing the Internet from an intranet, comprising the steps of:
[0008] S1. Internet users access the entrance of the hosted cloud load balancer through domain name resolution, and the balancer flows the data to the external server;
[0009] S2, a self-developed middleware application that reverse proxies the data flow to the backend middleware server through a reverse proxy web server on the external server;
[0010] S3, self-developed middleware applications accept external server requests for logical processing;
[0011] S4. After the logic processing is successful, the reverse proxy web server will perform a legal multi-layer reverse proxy on the user's incoming data flow again.
[0012] Furthermore, the logical processing steps in step S3 include:
[0013] S301. The self-developed middleware application accepts the data request from the external network server and submits the data stream to the enterprise WeChat interface server for identity authentication;
[0014] If the verification fails, an error message is returned to the client that the user information cannot be found;
[0015] If the verification is successful, the member information of the enterprise WeChat address book is obtained, and the identity verification information is returned to the middleware server;
[0016] S302: After the identity authentication is passed, the member information of the enterprise WeChat address book is obtained, and the user member information is secondarily verified in the self-developed middleware according to the obtained user information;
[0017] If the verification fails, the page indicating that the user has no permission to access is returned;
[0018] If the verification is successful, the user identity token is obtained, and the middleware server will return the data flow from the external network user to the external server.
[0019] Furthermore, the data flow of the multi-layer reverse proxy in step S4 is: the external server transmits to the middleware server, and the middleware server transmits to various application servers at the back end;
[0020] The data flow of the server's response to the user: the various application servers on the back end transmit to the middleware server, the middleware server transmits to the external server, and the external server transmits to the user end.
[0021] Furthermore, in the configuration file of the reverse proxy web server, a precise regular expression is used to match the forwarded address.
[0022] A system for intranet access to the Internet, comprising an external server, a middleware server and an intranet server;
[0023] For external servers, which are servers directly connected to the Internet, technicians need to configure a forwarding address on the reverse proxy web server as a forwarding address for user access requests;
[0024] Middleware server: connects to external servers and internal servers, accepts access requests through self-developed middleware applications, forwards user requests to the enterprise WeChat interface server, and then performs secondary authentication verification on user identity information;
[0025] Intranet server: Verify the identity authentication token obtained from the middleware server in the intranet office system.
[0026] Compared with the prior art, the present invention has the following beneficial effects:
[0027] According to actual needs, technical support configures nginx (reverse proxy web server) on external servers and middleware servers to forward information, and then verifies the legitimacy of forwarded user information through self-developed middleware, and forwards it to the business system again. Self-developed middleware verification provides user legitimacy verification and improves the interactivity of the entire process.
[0028] After forwarding through nginx (reverse proxy web server), the Internet can quickly and securely access the internal business system, and obtain user information through self-developed middleware applications to achieve single sign-on to the business system. That is, the internal and external networks are isolated without affecting the access to the business system. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 A flow chart of a method for an intranet to access the Internet according to the present invention;
[0030] Figure 2 This is a flow chart of the system structure of an intranet accessing the Internet according to the present invention;
[0031] Figure 3 Configure information code diagram for reverse proxy web server on external server;
[0032] Figure 4 Code diagram for configuring a reverse proxy web server on an intermediate server. DETAILED DESCRIPTION
[0033] In order to facilitate the understanding of those skilled in the art, the present invention is further described below in conjunction with embodiments and drawings. The contents mentioned in the implementation modes are not intended to limit the present invention.
[0034] like Figure 1 and 2 As shown, a method for an intranet to access the Internet includes the steps of:
[0035] S1. Internet users access the entrance of the managed cloud load balancer through domain name resolution, and the balancer forwards the data flow to the external server; S2. The external server reversely proxies the data flow to the backend middleware server through the reverse proxy web server. The self-developed middleware application compares the information forwarded by the Hypertext Transfer Protocol and forwards the user's information to improve interactivity.
[0036] S3, the self-developed middleware application accepts the external server request for logical processing; the logical processing flow steps in step S3 include:
[0037] S301. The self-developed middleware application accepts the data request from the external network server and submits the data stream to the enterprise WeChat interface server for identity authentication. If the authentication fails, an error message indicating that the user information cannot be found is returned to the client. If the authentication succeeds, the member information of the enterprise WeChat address book is obtained, and the identity authentication information is returned to the middleware server.
[0038] S302. After the identity authentication is passed, the member information of the enterprise WeChat address book is obtained, and the user member information is verified again in the self-developed middleware based on the obtained user information; if the verification fails, the user is returned to the page with no permission to access; if the verification passes, the user identity token is obtained, and the middleware server will return the data flow of the external network user end to the external server.
[0039] S4. After the logic processing is successful, the reverse proxy web server will perform a legal multi-layer reverse proxy on the user's incoming data flow again.
[0040] The data flow of the multi-layer reverse proxy in step S4 is: the external server transmits to the middleware server, and the middleware server transmits to various application servers at the back end; the data flow of the server responding to the user is: various application servers at the back end transmit to the middleware server, the middleware server transmits to the external server, and the external server transmits to the user end.
[0041] In the configuration file of the reverse proxy web server, accurate regular expressions are used to match the forwarded addresses. Accurate regular expressions are used to match the forwarded addresses, so that the system can achieve load balance, and the downtime of nginx (reverse proxy web server) will not affect the backend business servers.
[0042] A system for intranet access to the Internet, comprising an external server, a middleware server and an intranet server;
[0043] like Figure 3As shown, for an external server, a server used to directly connect to the Internet, technicians need to configure a forwarding address on the reverse proxy web server as a forwarding for user access requests.
[0044] Configuration information of nginx (reverse proxy web server) on the external server. Use in configuration:
[0045]
[0046]
[0047] like Figure 4 As shown in the figure, the middleware server: connects to external servers and internal servers, accepts access requests through self-developed middleware applications, forwards user requests to the enterprise WeChat interface server, and then performs secondary authentication verification on the user's identity information. If the verification fails, an error page of "user cannot find user information" is returned; if the verification passes, the member information of the enterprise WeChat address book can be obtained, and the user member information is secondary verified in the self-developed middleware application based on the obtained user information.
[0048] If the verification fails, an error page "The user does not have permission to access the page" is returned; if the verification passes, the user authentication token is obtained, and then forwarded to the intranet server through nginx (reverse proxy web server) on the middleware server.
[0049] Configuration of nginx (reverse proxy web server) on the intermediate server.
[0050] In configuration use:
[0051] / / Match system path
[0052] location~* / hx / oa / api / {
[0053] #Starting with a character path means you can access all files in the / hx / oa / directory
[0054] #Match regular expression, case insensitive
[0055] }
[0056] / / Match system static resources
[0057] location~*\.(gif / jpg / jpeg)${
[0058] #However, all images requested under / images / will be processed, because ^~ cannot reach this regular expression
[0059] }.
[0060] Intranet server: Verify the identity authentication token obtained from the middleware server in the intranet office system.
[0061] According to actual needs, technical support configures nginx (reverse proxy web server) on external servers and middleware servers to forward information, then verifies the legitimacy of the forwarded user information through self-developed middleware and forwards it to the business system again.
[0062] After forwarding through nginx (reverse proxy web server), the Internet can quickly and securely access the internal business system, and obtain user information through self-developed middleware applications to achieve single sign-on to the business system, that is, to achieve internal and external network isolation without affecting business system access.
[0063] The above is a detailed introduction to a method and system for intranet access to the Internet provided by the present application. The description of the specific embodiments is only used to help understand the system and its core idea of the present application. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the claims of the present application.
Claims
1. A method for accessing the Internet from an intranet, characterized in that: Includes steps: S1. Internet users access the entrance of the hosted cloud load balancer through domain name resolution, and the balancer flows the data to the external server; S2, a self-developed middleware application that reverse proxies the data flow to the backend middleware server through a reverse proxy web server on the external server; S3, self-developed middleware applications accept external server requests for logical processing; S4. After the logic processing is successful, the reverse proxy web server performs another legal multi-layer reverse proxy on the user's incoming data flow; The logical processing steps in step S3 include: S301. The self-developed middleware application receives the data request data flow from the external network server and submits it to the enterprise WeChat interface server for identity authentication; If the verification fails, an error message is returned to the client that the user information cannot be found; If the verification is successful, the member information of the enterprise WeChat address book is obtained, and the identity verification information is returned to the middleware server; S302: After the identity authentication is passed, the member information of the enterprise WeChat address book is obtained, and the member information of the user is secondarily verified in the self-developed middleware according to the obtained user information; If the verification fails, the page indicating that the user has no permission to access is returned; If the verification is successful, the user identity token is obtained, and the middleware server will return the data flow from the external network user to the external server.
2. A method for accessing the Internet from an intranet according to claim 1, characterized in that: The data flow of the multi-layer reverse proxy in step S4 is: the external server transmits to the middleware server, and the middleware server transmits to various application servers at the back end; The data flow of the server's response to the user: the various application servers on the back end transmit to the middleware server, the middleware server transmits to the external server, and the external server transmits to the user end.
3. A method for accessing the Internet from an intranet according to claim 2, characterized in that: In the configuration file of the reverse proxy web server, a regular expression is used to match the forwarded address.
4. A system for accessing the Internet from an intranet, characterized in that: Including external servers, middleware servers and intranet servers; For external servers, which are servers directly connected to the Internet, technicians need to configure a forwarding address on the reverse proxy web server as a forwarding address for user access requests; Middleware server: connects to external servers and internal servers, accepts access requests through self-developed middleware applications, forwards user requests to the enterprise WeChat interface server, and then performs secondary authentication verification on user identity information; Self-developed middleware applications accept external server requests for logical processing flow: The self-developed middleware application receives the data request data flow from the external network server and submits it to the enterprise WeChat interface server for identity authentication; If the verification fails, an error message is returned to the client that the user information cannot be found; If the verification is successful, the member information of the enterprise WeChat address book is obtained, and the identity verification information is returned to the middleware server; After the identity authentication is passed, the member information of the enterprise WeChat address book is obtained, and the member information of the user is verified again in the self-developed middleware based on the obtained user information; If the verification fails, the page indicating that the user has no permission to access is returned; If the verification is successful, the user identity token is obtained, and the middleware server returns the data flow from the external network user to the external server; Intranet server: Verify the identity authentication token obtained from the middleware server in the intranet office system.
