问题
I would like to have all HTTP requests made to my production environment be also automatically made against my testing environment. E.g. if anything makes a request to http://production.site.example.com/api/users/12345
then I want the same request to also be made against http://staging.site.example.com/api/users/12345
by some internal entity that sees the first request.
Is there an easy way to set this up in IIS without having to create a custom module or similar? If not, what is the best approach to take when creating such a module, so this does not cause any extra load on the production instance of my app?
回答1:
Not sure what specifically you're trying to achieve here but you might try with something simple such as implementing redirect in OnUnload event handler (I'm assuming you're using ASP.NET) that will redirect traffic to your test environment.
This way you get everything processed in your production environment and once that is completed you redirect request to test env. Again, not sure what specifically you're trying to do but I'd first try something simple like this using different redirects.
来源:https://stackoverflow.com/questions/14620883/how-to-set-up-iis-request-mirroring-to-staging-environment