实验环境
192.168.186.129 centos7
本地windows
关闭防火墙和selinux
systemctl stop firewalld setenforce 0
|
安装nginx、httpd
yum install nginx -y yum install httpd -y
listen 8080
systemctl start httpd
|
修改hosts文件
192.168.186.129 www.abctwf.com
|
编辑配置文件
vim /etc/nginx/nginx.conf server { listen 80 default_server; listen [::]:80 default_server; server_name 192.168.186.129; root /usr/share/nginx/html;
include /etc/nginx/default.d/*.conf;
location / { proxy_pass http://127.0.0.1:8080; }
error_page 404 /404.html; location = /40x.html { }
error_page 500 502 503 504 /50x.html; location = /50x.html { } }
|
测试
浏览器访问www.abctwf.com,即访问httpd首页
