0

我的 awstats 服务器上有多个域。现在我想保护其他客户的 URL。

真正的 url = host/awstasts.pl?config=DOMAIN

我该如何保护他们?我正在尝试使用特殊的标头/配置集,但这并不能解决我的问题,即客户可以猜测其他域。

我尝试类似的东西。

location /DOMAIN {
   set config-domain DOMAIN;
   add_header config_domain DOMAIN;
   return 301 host/awstats.pl?config=DOMAIN;
}

location /awstats.pl {
   if ($http_CONFIG-domain != "") { return 403; }
   if ($confi-domain != "") { return 403; }
fastcgi stuff

BASIC Authenfication 可能是一种解决方案,但每个 DOMAIN 都需要

有人能帮我吗?

//编辑没有secure_link的Debian 10 nginx/1.14.2

4

1 回答 1

0

通过测试解决。

location /domain-a
  {
    add_header Set-Cookie config=domain-a ;
    return 301 http://$host/awstats.pl?config=domain-a;
  }

location /domain-b
  {
    add_header Set-Cookie config=domain-b ;
    return 301 http://$host/awstats.pl?config=domain-b;
  }


  location /awstats.pl.
    {
      if ($cookie_config != $arg_config) { return 403; }

     //FASTcgi sTUFF


    }
于 2020-06-30T15:45:25.773 回答