Skip to content

Proxy based on user agent headers #620

Answered by chimurai
shelbyt asked this question in Q&A
Discussion options

You must be logged in to vote

You can have a look at the router option:

https://github.com/chimurai/http-proxy-middleware/blob/master/recipes/router.md#custom-router-function

createProxyMiddleware({
  target: 'http://localhost:8000',
  router: function (req) {
    // if googlebot (implement googlebot detection using the req object)
    return 'http://www.example.org'; // different target
  },
})

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@shelbyt
Comment options

@chimurai
Comment options

Answer selected by shelbyt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants