1. 配置本机的DNS
C:\Windows\System32\drivers\etc\hosts 末行添加 127.0.0.1 jay.localhost.com 可以直接访问 http://jay.localhost.com:8080/相当于直接访问 http://localhost:8080/
2. 可以nginx去代理端口号
upstream jay.localhost.com{ server 127.0.0.1:8080; } server { listen 80; server_name jay.localhost.com; location / { proxy_pass http://jay.localhost.com; proxy_set_header X-forwarded-for $proxy_add_x_forwarded_for; } }