I have tried adding the following to the nginx config to no avail.
proxy_set_header X-Forwarded-Host mydomain.com:443;
I think this is the portion of code that is making the call looking for
that value.
*static* UriComponents *componentsFrom*(HttpServletRequest request) {
ServletUriComponentsBuilder builder = ServletUriComponentsBuilder.
*fromServletMapping*(request);
ForwardedHeader forwarded = ForwardedHeader.*of*(request.getHeader
(ForwardedHeader.NAME));
String proto = *hasText*(forwarded.getProto()) ? forwarded.getProto() :
request.getHeader("X-Forwarded-Proto");
String forwardedSsl = request.getHeader("X-Forwarded-Ssl");
*if* (*hasText*(proto)) {
builder.scheme(proto);
} *else* *if* (*hasText*(forwardedSsl) && forwardedSsl.equalsIgnoreCase(
"on")) {
builder.scheme("https");
}
String host = forwarded.getHost();
host = *hasText*(host) ? host : request.getHeader("X-Forwarded-Host");
<----------------------------
*if* (!*hasText*(host)) {
*return* builder.build();
}
String[] hosts = *commaDelimitedListToStringArray*(host);
String hostToUse = hosts[0];
*if* (hostToUse.contains(":")) {
String[] hostAndPort = *split*(hostToUse, ":");
builder.host(hostAndPort[0]);
builder.port(Integer.*parseInt*(hostAndPort[1]));
} *else* {
builder.host(hostToUse);
builder.port(-1); // reset port if it was forwarded from default port
}
String port = request.getHeader("X-Forwarded-Port");
*if* (*hasText*(port)) {
builder.port(Integer.*parseInt*(port));
}
*return* builder.build();
}
Thanks,
TCD
On Wednesday, July 27, 2016 at 4:10:40 PM UTC-5, TurboChargedDad wrote:
>
> I have been charged with getting rid of our Apache Proxy servers in
> favor of nginx.
>
>
--
You received this message because you are subscribed to the Google Groups
"Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.