找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 30|回复: 3

nginx怎么在没有URI时返回444?

[复制链接]

6

主题

8

回帖

36

积分

新手上路

积分
36
发表于 2017-7-12 10:40:52 | 显示全部楼层 |阅读模式
http://www.xxx.com/ 444
http://www.xxx.com/zzzz  正常访问



下面的不好使
                        if ($document_uri = '') {
                                return 444;
                        }
回复

使用道具 举报

79

主题

457

回帖

1163

积分

金牌会员

积分
1163
发表于 2017-7-12 10:43:02 | 显示全部楼层
location  = / {
  
    return 404;
}
回复

使用道具 举报

120

主题

1648

回帖

3678

积分

论坛元老

积分
3678
发表于 2017-7-12 10:46:08 | 显示全部楼层
[ol]
  • server {
  • error_page 500 502 503 504 =444 @blackhole;
  •   location @blackhole {
  •     return 444;
  •   }
  • }[/ol]复制代码

    https://stackoverflow.com/questions/41421111/http-444-no-response-instead-of-404-403-error-pages
  • 回复

    使用道具 举报

    6

    主题

    8

    回帖

    36

    积分

    新手上路

    积分
    36
     楼主| 发表于 2017-7-12 10:53:44 | 显示全部楼层

    shc 发表于 2017-7-12 10:46

    https://stackoverflow.com/questions/41421111/http-444-no-response-instead-of-404-403-error-pages

    不 对
    回复

    使用道具 举报

    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    Archiver|手机版|小黑屋|Discuz! X

    GMT+8, 2025-2-12 12:27 , Processed in 0.021132 second(s), 4 queries , Gzip On, Redis On.

    Powered by Discuz! X3.5

    © 2001-2024 Discuz! Team.

    快速回复 返回顶部 返回列表