mkopylec / charon-spring-boot-starter

Reverse proxy implementation in form of a Spring Boot starter.
Apache License 2.0
240 stars 54 forks source link

Requests are not forwarded to subdomains #143

Open nurrony opened 8 months ago

nurrony commented 8 months ago

I am getting the log from Charon as follows. As per the log it is rewriting the path correctly. But getting 404.

I found this https://github.com/mkopylec/charon-spring-boot-starter/pull/123

does Charon support forwarding request to subdomain or am I am doing it wrong?

Forwarding: GET http://localhost:8000/services/api/entities -> 'foo-resources' -> GET https://resources.foo.com/api/entities 404
public CharonConfigurer charonConfigurer() {
  var outgoingServer = requestServerNameRewriter().outgoingServers("https://resources.foo.com");
  var pathRewriter = regexRequestPathRewriter().paths("/services/(?<path>.*)", "/<path>");
  var pathMapper = requestMapping("foo-resources").pathRegex("/services/(?<path>.*)");
  return charonConfiguration().add(pathMapper).set(pathRewriter).set(outgoingServer);
}
mkopylec commented 5 months ago

The logs clearly states that the outgoing server returned 404. Have you tried curl on the outgoing URL?

curl -i https://resources.foo.com/api/entities

What does the above command return?