First, installation steps:
cd /appwget http://nginx.org/download/nginx-1.6.3.tar.gzunzip nginx-1.6.3.tar.gzcd /app/nginx-1.6.3./configuremakemake install
Ii. Configuring load Balancing in nginx.conf files
worker_processes1;Events{worker_connections1024x768;}http{includeMime.types;Default_typeApplication/octet-stream;Log_formatMain'$remote _addr - $remote _user [$time _local] "$request"'$status$body _bytes_sent '$http _referer '' "$http _user_agent" "$http _x_forwarded_for" ';UpstreamBaidu {Server10.100.138.1:8080;Server10.100.138.2:8080; }Server{Listen the;server_namewww.baidu.com;Access_log/app/nginx/logs/baidu.log main; Location/ {Proxy_set_headerHost$host;Proxy_set_headerX-real-ip$remote _addr;Proxy_set_headerX-forwarded-for$proxy _add_x_forwarded_for;Proxy_passHttp://baidu; } }}
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
The above describes the HTTP-based reverse proxy, including the aspects of the content, I hope that the PHP tutorial interested in a friend helpful.