如何设置IIS请求镜像到暂存环境? [英] How to set up IIS request mirroring to staging environment?

查看:48
本文介绍了如何设置IIS请求镜像到暂存环境?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望所有针对我的生产环境的HTTP请求也可以根据我的测试环境自动进行.例如.如果有什么要求发送 http://production.site.example.com/api/users/12345 的请求,那么我希望对 http://staging也发送相同的请求.看到第一个请求的某个内部实体的site.example.com/api/users/12345.

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.

是否有一种简单的方法可以在IIS中进行设置,而无需创建自定义模块或类似模块?如果不是,那么在创建这样的模块时采取的最佳方法是什么,那么这不会对我的应用程序的生产实例造成任何额外的负担?

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?

推荐答案

不确定在此要具体实现什么,但是您可以尝试一些简单的操作,例如在OnUnload事件处理程序中实现重定向(我假设您已经重新使用ASP.NET),将流量重定向到您的测试环境.

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.

这篇关于如何设置IIS请求镜像到暂存环境?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆