轉載鏈接:http://blog.csdn.net/staricqxyz/article/details/16984029
將域名指向Nginx服務器
訪問www.test.com會轉發到192.168.1.22,192.168.1.23
- user??nobody?nobody;??
- worker_processes??1;??
- ??
- ??
- events?{??
- ????worker_connections??1024;??
- }??
- ??
- ??
- http?{??
- ????include???????mime.types;??
- ????default_type??application/octet-stream;??
- ??
- ??
- ??
- ????sendfile????????on;??
- ??
- ????keepalive_timeout??65;??
- ??????
- ????upstream?www.test.com?{??
- ????server?192.168.1.22:80;??
- ????server?192.168.1.23;?????
- ??
- ????}??
- ??
- ????server?{??
- ????????listen???????80;??
- ????????server_name??www.test.com;??
- ??
- ??
- ??
- ????????location?/?{??
- ????????????proxy_pass?http://www.test.com;??
- ????????}??
- ??
- ??
- ????????error_page???500?502?503?504??/50x.html;??
- ????????location?=?/50x.html?{??
- ????????????root???html;??
- ????????}??
- ??
- ????}??
- ??
- }?