安装nginx
下载
tar
./configure
(
安装Nginx时报错
./configure:error:theHTTPrewritemodulerequiresthePCRElibrary.
安装pcre-devel解决问题
yum-yinstallpcre-devel
)
make&&makeinstall
默认安装到
/usr/local/nginx
启动
/usr/local/nginx/sbin/nginx
关闭nginx
pkill-9nginx
跳转
server{
listen80;
server_namelocalhost;
location/{
proxy_passhttp://192.168.1.100:8080;
}
}
也可以通过yum安装
rpm-ivhhttp://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm
yuminfonginx
yuminstallnginx