假设我有一个域名"example.com“。现在,使用caddy,我已经将example.com配置为运行在本地主机8080上的springboot应用程序的代理。如何正确地转到应用程序中的其他路由?例如,如果我转到https://example.com/user,url将是: example.com/user。但是,如果我从springboot应用程序内部路由到/login (假设在控制器中的用户路由的末尾使用return new RedirectView("/login") ),它会将我重定向到http:serverIpAdress:8080//login。我如何才能将其路由到https://example.com/login
发布于 2020-04-07 20:16:29
这不是Spring的问题;需要正确配置Caddy,如下所示:
subdomain {
proxy / ipAddress:port {
transparent
}
}1)注意caddyfile中的间距。我最初尝试过这个方法,但它不起作用,我相信原因是因为我创建了这样的文件:subdomain{ proxy / ipAddress:port { transparent }} 2)它确实起作用了,因为从我在互联网上看到的许多地方它似乎从api中删除了透明的
https://stackoverflow.com/questions/61015535
复制相似问题