yum默认没有nginx的安装包需要先下载好RPM包
wget http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm
默认用yum -y install nginx 安装好之后就可以用 http://ip 去访问nginx
如果想访问 http://ip/contentweb/
怎需要修改vim /etc/nginx/conf.d/default.conf
location / {
root html;
index index.html index.htm;
}
下面加上
location /contentweb/
{
alias /usr/local/contentweb/;
}
重启nginx即可
原文地址:http://1107916963.blog.51cto.com/8735115/1550201