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

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

[复制链接]

23

主题

25

回帖

127

积分

注册会员

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



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

使用道具 举报

149

主题

1200

回帖

2919

积分

金牌会员

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

使用道具 举报

340

主题

3558

回帖

8214

积分

论坛元老

积分
8214
发表于 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
  • 回复

    使用道具 举报

    23

    主题

    25

    回帖

    127

    积分

    注册会员

    积分
    127
     楼主| 发表于 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-4-21 15:48 , Processed in 0.015088 second(s), 3 queries , Gzip On, Redis On.

    Powered by Discuz! X3.5

    © 2001-2024 Discuz! Team.

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