域名解析:
1,通过SwitchHosts文件配置
,实际修改的是系统的host文件
2, 配置端口, 80端口为nginx监听,通过端口反向代理到对应的对应的微服务
server {
listen 80;
server_name manage.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 / {
proxy_pass http://127.0.0.1:9001;
proxy_connect_timeout 600;
proxy_read_timeout 600;
}
}
3,nginx -s reload即可