In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)05/31 Report--
Most people do not understand the knowledge points of this article "windows installation nginx deployment reverse proxy and load balancing method", so the editor summarizes the following contents, detailed contents, clear steps, and has a certain reference value. I hope you can get something after reading this article. Let's take a look at this "windows installation nginx deployment reverse proxy and load balancing method" article.
Download and install nginx (the environment of this article is windows xp 32bit environment)
Extract the nginx-1.0.11.zip, enter nginx-1.0.11, and execute the command on the command line to start nginx. The specific operation is as follows:
To test whether the installation is successful, enter the address:
The browser displays the results as shown below:
The ok,nginx deployment was successful.
Second, about the reverse proxy configuration of nginx.
Reverse proxy (reverse proxy) means that the proxy server accepts the connection request on the internet, then forwards the request to the server on the internal network, and returns the result obtained from the server to the client requesting the connection on the internet. At this time, the proxy server is externally represented as a server.
Regarding the configuration of reverse proxy for nginx, take Baidu Google as an example, the configuration file nginx.conf (path: d:\ nginx\ nginx-1.0.11\ nginx-1.0.11\ conf) is as follows:
The copy code is as follows:
Location / baidu {
Proxy_pass http://www.google.com;
Proxy_set_header host $host
Proxy_set_header x-forwarded-for $proxy_add_x_forwarded_for
}
Where "/ baidu" is mapped to "http://www.google.com"".
Test access:
Access results:
Although the interface displays errors, the effect has been achieved.
Third, load balancing test.
There are two tile service addresses. Use nginx as a load balancer. The configuration file is as follows:
The copy code is as follows:
Upstream cluster {
Server 192.98.12.60:1985 weight=3 max_fails=2 fail_timeout=30s
Server 192.98.12.42:8086 weight=3 max_fails=2 fail_timeout=30s
}
Server {
Listen 8090
Server_name localhost
# charset koi8-r
# access_log logs/host.access.log main
Location / {
Root html
Index index.html index.htm
}
Location / tileservice {
Proxy_pass http://cluster/mongotileservice/tileservice;
Proxy_set_header host $host
Proxy_set_header x-forwarded-for $proxy_add_x_forwarded_for
}
Once configured, nginx-s reload address: you can get the service image:
The above is the content of this article on "windows installation nginx deployment reverse proxy and load balancing method". I believe everyone has a certain understanding. I hope the content shared by the editor will be helpful to you. If you want to learn more about the relevant knowledge, please follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un