nginx
我的ng配置文件的路径
vi /etc/nginx/nginx.conf
配置2个服务器
upstream webServer {
server 127.0.0.1:3333;
}
upstream serviceServer {
server 127.0.0.1:8888;
}
server {
listen 80;
server_name www.abc.com;
location / {
proxy_pass http://webServer;
}
}
server {
listen 80;
server_name service.abc.com;
location / {
proxy_pass http://serviceServer;
}
}
这样就配置好2个server
安装
已经把安装包上传到 opt/soft 前提下
228 cd /opt/soft/
229 ls
230 tar zxvf nginx-1.10.3.tar.gz
231 cd nginx-1.10.3
232 ls
233 ./configure --prefix=/usr/local/nginx
234 yum -y install gcc
235 ./configure --prefix=/usr/local/nginx
236 yum -y install pcre
237 yum -y install pcre-devel
238 ./configure --prefix=/usr/local/nginx
239 make
240 make install
241 cd /usr/local/nginx/
242 ls
243 cd sbin/
244 ls
245 ./nginx
246 ps aux | grep nginx