-
Can I route based on the user-agent header? For example, if a header comes in with |
Beta Was this translation helpful? Give feedback.
Answered by
chimurai
May 28, 2021
Replies: 1 comment 2 replies
-
You can have a look at the createProxyMiddleware({
target: 'http://localhost:8000',
router: function (req) {
// if googlebot (implement googlebot detection using the req object)
return 'http://www.example.org'; // different target
},
}) |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
shelbyt
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can have a look at the
router
option:https://github.com/chimurai/http-proxy-middleware/blob/master/recipes/router.md#custom-router-function