一、下载nginx
链接:http://nginx.org/en/download.html
1-2 安装包1.14下载
链接:http://nginx.org/download/nginx-1.14.0.zip
二、修改nginx.conf文件(在本机配置静态原型)
worker_processes 1; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 65; server{ listen 80; #需要配置host文件 127.0.0.1 www.xuecheng.com server_name www.xuecheng.com; #打开SSI ssi on; # 让报错页面不让用户看到 ssi_silent_errors on; location / { alias D:/workspace_webStorm/xc-ui-pc-static-portal/; index index.html; } } }
三、在c盘的配置hosts文件(目的是:当本机访问www.xuecheng.com的时候先本机读取虚拟的域名)
四、重启Nginx
./Nginx -s reload 或者 window下的nginx重启