@neo 吾皇请教一下,我服务器部署了uptime ,现在想用nginx代理,访问域名status.xxx.com 和 xxx.com 的时候 直接跳转到ip:3001/status/dash(状态页面,访问xxx.com/dash的时候可以到后台登录页面ip:3001/dashboard,但是浏览器地址不变,想实现这个nginx需要怎么配置呢? 我看status.linux.do 和http://status.fakeopen.com 都是这样实现的,地址没有重定向
我目前实现了访问xxx.com的时能重定向到/status/dash,但是对应的地址也变成了xxx.com/status/dash.
server {
server_name domain.com status.domain.com;
location = /dash {
return 301 $scheme://$host/dashboard;
}
location / {
proxy_pass http://localhost:3001/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}