安装Nginx,配置域名转发

Posted by yuk on 2016-01-10

安装Nginx

1
yum install nginx

备份配置文件

1
2
3
$ cd /etc/nginx/conf.d
$ cp default.conf default.conf.bak
$ vi default.conf

简单的配置

1
2
3
4
5
6
7
server {
listen 80;
server_name www.fiveight.cn;
location / {
proxy_pass http://localhost:3210;
}
}

查看Nginx启动的配置文件

1
$cat /etc/nginx/nginx.conf

这一行 include /etc/nginx/conf.d/*.conf; 会执行目录下的所有conf文件,可以在此自定义到任何路径

启动ningx

1
$ service nginx start