Home > Article > Operation and Maintenance > How to use nginx forward proxy to forward intranet domain names
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:
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.
Create a new configuration file in the /application/nginx/conf/conf.d directory
vim oa.xxxxx.com.conf
Write as follows
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
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!