1 在首页打开Nginx后创建一个网站h5.lxtest.laixuejigou.com
2 在设置里选择配置文件 再选择vhosts.conf打开删除多余的替换成:如下
server {
listen 80;
server_name h5.laixue.com;
location / {
index index.php index.html error/index.html;
proxy_pass http://192.168.1.175:8080/; // 对应的是本地的
}
}
再打开C:\Windows\System32\drivers\etc\hosts查看一下:如下图
3 使用的时候把本地的http://192.168.1.175:8080/换成配置的h5.lxtest.laixuejigou.com就可以进行调试了