只允许1.2.3.4这个IP访问我们的站点,拒绝所有其他IP的访问。

server {

    listen 80;

    server_name www.example.com;

    satisfy any;

    allow 1.2.3.4;

    deny all;

    auth_basic "INPUT YOUR USERNAME:";

    auth_basic_user_file /usr/local/nginx/conf/passwd;

}

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-05-16
  • 2022-12-23
  • 2021-11-27
  • 2021-06-21
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-07-05
  • 2021-08-13
  • 2021-09-16
  • 2021-05-21
  • 2021-07-25
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案