将网站向公众公开,但留作测试......“我们不开放”

发布于 2024-07-08 08:04:28 字数 174 浏览 5 评论 0原文

我们明天将为使用 IIS 的客户推出一个网站。

我将把该网站向公众开放(抱歉,我们正在更新消息),并允许客户在执行升级后在周末进行测试。

如果成功,我将其向所有人开放 - 如果不成功,我将回滚。

向公众展示“我们不开放”标志,但将其余部分留给测试人员开放的最简单方法是什么?

We are rolling out a site for a client using IIS tomorrow.

I am to take the site down to the general public (Sorry, we are updating message) and allow the client to test over the weekend after we perform the upgrade.

If it is successful, I open it to everbody - if not, I rollback.

What is the easiest way to put a "We're not open" sign for the general public, but leave the rest open to testers?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

ぽ尐不点ル 2024-07-15 08:04:28

通过 IIS 重定向。 在 IIS 中创建一个新网站,并将“抱歉正在更新”消息放入 Default.aspx 中。 然后在真实站点(将从 80 切换到其他站点 (6666))和“维护”站点(设置为 80)之间切换端口。

然后告诉您的测试人员访问 yoursite.com:6666。

然后在取下“维护”站点后将真实站点切换回80。

Redirect via IIS. Create a new website in IIS and put your "Sorry updating" message in the Default.aspx. Then switch ports between the real site (will go from 80, to something else (6666)) and the 'maintenance' site (set on 80).

Then tell your testers to go to yoursite.com:6666.

Then switch the real site back to 80 after taking down the 'maintenance' site.

筑梦 2024-07-15 08:04:28

我认为值得一提的是 ASP.NET 2.0+ 的“应用程序离线”功能。 (是的,我意识到提问者希望将应用程序留下来进行测试,但我是为后来可能有不同需求的读者写这篇文章的)。

如果您确实想让每个人应用程序离线(例如进行服务器维护),有一个非常简单的选择。 在 ASP.NET 2.0 及更高版本中,您所要做的就是将一个具有以下名称的文件放在

app_offline.htm

ASP.NET 应用程序的根目录中:...。 在其中添加适当的“抱歉稍后再来”消息。 就是这样。 ASP.NET 运行时会完成剩下的工作。

有关 Scott Guthrie 的博客的详细信息。

I thought it would be worthwhile to mention ASP.NET 2.0+'s "app offline" feature. (Yes, I realize the questioner wants to leave the app up for testing, but I'm writing this for later readers who might come here with different needs).

If you really want to take the application offline for everyone (for instance to do server maintenance) there is a very simple option. All you have to do in ASP.NET 2.0 and higher is put a file with this name:

app_offline.htm

...in the root directory of your ASP.NET application. Put an appropriate "sorry come back later" message in there. That's it. The ASP.NET runtime does the rest.

Details on Scott Guthrie's blog.

忘羡 2024-07-15 08:04:28

要求测试人员登录。 您甚至可以隐藏登录页面,这样您就需要直接链接才能看到它。 然后,对于所有未登录的人,重定向到显示您的消息的页面。

Require that testers login. You can even hide the login page so that you need a direct link to even see it. Then, for all people not logged in, redirect to the page that displays your message.

水晶透心 2024-07-15 08:04:28

在 IIS 中启动另一个“站点”,它将捕获主站点的主机标头。 使用带有“我们正在维护”的自定义 307/503/404 页面,或者使用某种 URL 重写将人们重定向到您的单个静态文件。

将真实站点上的主机头绑定切换为其他内容,例如开发人员使用的 dev.domain.com 或testing.domain.com。

或者,通过 IP 进行阻止,并让您的自定义“未授权”页面告诉访问者您正在维护。

您有多种选择。

Fire up another "site" in IIS which will catch your host-header for your primary site. Use either a custom 307/503/404 page that has "we're down for maintainance" or use some sort of URL-rewrite to redirect people to your single static file.

switch host-header-binding on your real site to something else, like dev.domain.com or testing.domain.com that your developers use.

Or, block by IP, and have your custom "Not authorized" page tell visitors that your down to maintainance.

You have several options.

日暮斜阳 2024-07-15 08:04:28

我之前使用过的一些方法:

  • Windows 身份验证和/或单独的子域供客户端测试。
  • 在 IIS 中禁用匿名网站访问,并为您的客户端提供用户名/密码组合来测试网站。
  • 禁用 IIS 中的默认文档,并为您的客户端提供主索引文件的绝对 URL。

Some methods that I've used before:

  • Windows authentication and/or separate subdomains for client to test.
  • Disable anonymous website access in IIS and give your client a username/password combo to test the website.
  • Disable default document in IIS and give your client an absolute URL to the main index file.
嗼ふ静 2024-07-15 08:04:28

我们倾向于在站点的所有页面上有一个登录页面和一个包含文件(通常是数据库连接,因为它包含在所有文件中),用于检查有效的登录会话。 如果您尚未登录,您会收到一条消息,指出该网站已关闭以进行维护

We tend to have a log in page and an include file across all pages in the site (usually the DB Connection as it's included in all files) that checks for a valid logged in session. If you've not logged in you get a message saying the site's down for maintainance

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文