motiv-labs / janus

An API Gateway written in Go
https://hellofresh.gitbooks.io/janus
MIT License
2.77k stars 319 forks source link

Can janus proxy a web page instead of an single target url #417

Open chenliejun opened 4 years ago

chenliejun commented 4 years ago

[Short description of problem here]

I am thinking:janus as an api gateway to proxy upstream api serice,can it proxy the total web page with sub request of css、js、png so on.

Reproduction Steps:

  1. [First Step] Create an API Definition with Set the listen_path as :/something, Set the upstream target as: http://my.private.blogsite.com(some real blog site)
  2. [Second Step] visit http://localhost:8080/something
  3. [Other Steps...] got the page with single html,but the page's css、js、png got the 404 response(which are the request in the html some like:/css/blog.css、/js/jquery-1.11.3.min.js、/img/favicon.png)

Expected behavior: proxy all the regular target ,just like nginx.as so the css、png、js can also be proxied

[Describe expected behavior here] can the upstream target can be set with the same rule as listen_path,es:http://my.private.blogsite.com/*