About the program: The company has a customer, need to access our business interface, but their servers inside the network, can not access the external network, but the LAN inside the other servers to access the Internet, so want to configure the agent in the LAN, to achieve proxy access.
(1) Required software and basic requirements
Nginx software A host that can sisu the network.
Nginx software http://nginx.org/en/download.html can be downloaded in the official website, download, unzip, you can click on the setup installation, but it is important to note that the default port is 80 port, to prevent the host 80 port is occupied.
(2) Several common nginx commands
Start Nginx
Nginx-s Reload Reload configuration file
Nginx-s Stop Stop
Nginx-s quit stop
Tasklist/fi "imagename eq nginx.exe" To view information such as its processes
Note: We can also view the log in the logs directory to see the Access.log,error.log two files. You can see its associated log information. You also need to be aware of firewall issues so that you do not have normal access.
(3) Start Nginx, you can use the start Nginx command, can also use set up to start, in the browser access, can appear the page is normal.
650) this.width=650; "Src=" Http://s2.51cto.com/wyfs02/M00/84/19/wKiom1eFtOWg1t69AACrixvIoxI483.png-wh_500x0-wm_3 -wmp_4-s_2510636212.png "title=" Nginx.png "alt=" Wkiom1eftowg1t69aacrixvioxi483.png-wh_50 "/>
(4) Configuration of the agent
1. On #gzip, open the configuration and add the following configuration to handle the file during the agent process.
Gzip_min_length 1k;
Gzip_buffers 4 16k;
Gzip_http_version 1.0;
Gzip_comp_level 4;
Gzip_vary on;
Gzip_types text/plain text/css text/xml application/x-javascript application/xml application/atom-xml text/javascript ;
2, the agent part of the configuration
server {
Listen 8011;
server_name localhost;
#charset Koi8-r;
#access_log Logs/host.access.log Main;
Location/{
root HTML;
Index index.html index.htm;
}
location/sendmsg {
Proxy_pass HTTP://192.168.1.198:1210/SERVICES/MSGSEND.ASMX/SENDMSG;
proxy_set_header Host $host;
proxy_set_header x-forwarded-for $proxy _add_x_forwarded_for;
}
Location/getreport {
Proxy_pass Http://192.168.1.198:1210/Services/MsgSend.asmx/GetReport;
proxy_set_header Host $host;
proxy_set_header x-forwarded-for $proxy _add_x_forwarded_for;
}
This is possible, because we have changed the configuration file and need to restart the service, mainly to load the configuration file.
Once the reboot is successful, the test can be accessed.
650) this.width=650; "Src=" Http://s2.51cto.com/wyfs02/M00/84/19/wKioL1eFtwnzrk6kAAAwonulnYs715.png-wh_500x0-wm_3 -wmp_4-s_2468331670.png "title=" Get.png "alt=" Wkiol1eftwnzrk6kaaawonulnys715.png-wh_50 "/>
650) this.width=650; "Src=" Http://s2.51cto.com/wyfs02/M00/84/1A/wKiom1eFtwnwrO0kAAA9Ky-6EUs045.png-wh_500x0-wm_3 -wmp_4-s_3307967794.png "title=" qq picture 20160713113355.png "alt=" Wkiom1eftwnwro0kaaa9ky-6eus045.png-wh_50 "/>
This is our interface callback parameters, this article will be our address has been changed, with the intranet address to demonstrate a bit. This scenario is just one of our case notes, for your reference only.
This article is from the "It Rookie" blog, make sure to keep this source http://9089323.blog.51cto.com/9079323/1825995
The Nginx proxy Internet solution based on Windows server2008