1.修改host解析
2.使用Nginx代理,实现域名访问
进入Nginx的安装路径E: oolsoftware ginx-1.14.0 ginx-1.14.0conf,修改
添加如下内容:
server {
listen 80;
server_name image.leyou.com;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
location / {
root C:\Users\image;
}
}
范例:
重新加载Nginx
3.访问测试
浏览器输入:http://image.leyou.com/images/4/11/1524297413085.jpg