{ "_links" : {
"orders" : {
"href" : "http://localhost:8080/orders"
},
"profile" : {
"href" : "http://localhost:8080/api/alps"
}
}
}此结果由Springboot Rest数据生成。我计划将此应用程序放在Nginx后面,它将侦听安全端口(443)。即使我的应用程序仍然在8080上运行,我如何将_links端口从8080更改为443?
发布于 2016-05-30 16:12:57
spring boot data rest将从请求中读取主机和方案作为基本url,所以你应该告诉spring boot真实的主机和方案。这个nginx配置适用于我:
location /api/ {
proxy_pass http://localhost:8080/;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-forwarded-Prefix /api;
}https://stackoverflow.com/questions/33743038
复制相似问题