This provides only one way to direct the interface for location distribution. The simplest configuration makes it clear that the interface is directed for distribution and is not explained for other configurations. such as requesting two url:1), Www.000.com/sale
2),www.000.com/matchmaker
- #user nobody;
- Worker_processes 1;
- Events {
- Worker_connections 1024;
- }
- http {
- Include Mime.types;
- Default_type Application/octet-stream;
- Sendfile on;
- Keepalive_timeout 65;
- Upstream Sale {
- server 192.168.1.100:8000 max_fails=2;
- }
- Upstream Matchmaker {
- Server 192.168.1.200:8080 max_fails=2;
- }
- Server {
- Listen;
- server_name www.000.com;
- Location/sale {
- Root/www
- Proxy_pass Http://sale;
- }
- Location/matchmaker {
- Root/www
- Proxy_pass Http://matchmaker;
- }
- }
- }
Description: When the request/HTTP/
www.000.comWhen/sale arrives, listen for the domain name on port 80 port
www.000.comAccording to the location match to sale, and then according to the field Proxy_pass Http://sale to find the corresponding upstream, then the request will arrive 192.168.1.100:8000 this machine. It's done. Load balancing based on URL directed forwarding
Load balancing based on URLs