How to use nginx forward proxy to forward intranet domain names

王林
Release: 2023-05-15 21:46:04
forward
3805 people have browsed it

In the customer's intranet environment, ppoe is used to dial up the Internet. The provider is a secondary operator within the group. The network environment is relatively complex. The group's internal network and office network are interconnected using a static routing protocol. The general situation is as follows:

How to use nginx forward proxy to forward intranet domain names

Originally, customers accessed production services through IP addresses. With the increasing number of production services, customers now strongly require the use of domain names to access services. However, given the complexity of the intranet environment, it is difficult to deploy a domain name server, and it is also difficult to deploy access services.

Later I learned nginx and learned that nginx can implement forward proxy to realize domain name forwarding.

Instructions:

1. Configure domain name resolution on Alibaba Cloud. For example, oa.xxxx.com, the resolved address is the intranet address 172.31.101.36

2, 172.31.101.36 is the VIP address, which is provided by two nginx configuration keepalived

3. The general access process is that the customer accesses the domain name, the domain name is resolved to the VIP intranet address, and the intranet nginx service forwards the domain name request to the designated intranet server

In order to complete the entire process, it must be ensured that the nginx server can be accessed External network, and can be connected to the designated production server network of the internal network. At the same time, the customer can resolve the domain name normally after dialing through PPO.

What needs to be explained is the configuration of nginx proxy forwarding. I use the sub-configuration method.

How to use nginx forward proxy to forward intranet domain names

Create a new configuration file in the /application/nginx/conf/conf.d directory

vim oa.xxxxx.com.conf
Copy after login

Write as follows

How to use nginx forward proxy to forward intranet domain names

After the configuration is completed, check the nginx syntax and restart the nginx process

/application/nginx/sbin/nginx -t
/application/nginx/sbin/nginx -s reload
Copy after login

After the configuration is completed, check whether the domain name is valid

The above is the detailed content of How to use nginx forward proxy to forward intranet domain names. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:yisu.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template