nginx为特定用户显示一个html页面

时间:2012-06-15 16:07:35

标签: nginx rewrite

我想向certrain国家/地区展示一个服务不可用的页面,它需要显示他们访问的URL,我该怎么做?

表示用户类型:domain.com/whatever我们将显示静态页面unavailable.html或转发给他们的所有时间内容。静态内容文件位于另一个根目录中。

if ($allow_visit = no) {
  rewrite ^(.*)$ /unavailable.html last;
}

1 个答案:

答案 0 :(得分:1)

您在谈论nginx Geo module。文档还包含有关如何创建自己的基于MaxMind的配置文件的链接。