保存以后会在/etc/yum.repos.d/中创建nginx.repo文件
1、编辑/etc/nginx/nginx.conf
//在nginx.conf中,有一行代码,代表它去加载文件夹/conf.d/中的所有.conf文件 include /etc/nginx/conf.d/*.conf;2、编辑/etc/nginx/conf.d文件
server { listen 80; server_name localhost; #charset koi8-r; #access_log /var/log/nginx/host.access.log main; location / { root /usr/share/nginx/html; index index.html index.htm; } .... }3、一台主机上适应多个服务器
http { .... server { listen 80; server_name www.a.com; charset utf-8; access_log /home/a.com.access.log main; location / { proxy_pass http://127.0.0.1:80; } } server { listen 80; server_name www.b.com; charset utf-8; access_log /home/b.com.access.log main; location / { proxy_pass http://127.0.0.1:81; } } ...