匹配规则
完全匹配
1 | http { |
- 测试命令
curl -i “test1.com/“ -> 查询server_name成功,默认匹配到第1个server,返回500
curl -i “test2.com/“ -> 查询server_name成功,默认匹配到第2个server,返回508
curl -i “test3.com/“ -> 查询server_name失败,默认匹配到第1个server,返回500
禁止非法域名
1 | http { |
- 测试命令
curl -i “test1.com/“ -> 查询server_name成功,返回500
curl -i “test2.com/“ -> 查询server_name失败,返回403
curl -i “127.0.0.1/“ -> 查询server_name失败,返回403